3v4l.org

run code in 300+ PHP versions simultaneously
<?php ob_start(); $sfid = ''; $sa = ''; $lo = ''; $ra = ''; $numrec = ''; try { $arrayleadurimap= array( "[email protected]" => "Charles Brown", "[email protected]" => "Chad Devero", "[email protected]" => "Chantz Gnad", "[email protected]" => "Chad Lee", "[email protected]" => "Chris Meyn", "[email protected]" => "Jared Borberg", "[email protected]" => "Josh Holloway", "[email protected]" => "Karon McGlinn", "[email protected]" => "Michaell Wallace-Beaven", "[email protected]" => "Matt Fisher", "[email protected]" => "Martin Wehrenberg", "[email protected]" => "Pam Castrey", "[email protected]" => "Terrence Abney", "[email protected]" => "Terence Gunn", "[email protected]" => "Trey Sparks", "[email protected]" => "Caleb Foreman", "[email protected]" => "Greg Weber", "[email protected]" => "Chris Kneedler", "[email protected]" => "Ryan Haynes", "[email protected]" => "Beau Bryan", "[email protected]" => "Nancy Sisson" ); $username = $_GET["username"]; $password = $_GET["password"]; $number = $_GET["number"]; $url="https://login.salesforce.com/services/Soap/c/28.0/0DFd0000000HB01"; $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>". "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:tns=\"urn:enterprise.soap.sforce.com\">". "<soap:Header>". "<tns:LoginScopeHeader>". "<tns:organizationId/>". "</tns:LoginScopeHeader>". "</soap:Header>". "<soap:Body>". "<tns:login>". "<tns:username>".$username."</tns:username>". "<tns:password>".$password."</tns:password>". "</tns:login>". "</soap:Body>". "</soap:Envelope>"; $headers = array( 'Content-Type:text/xml; charset=utf-8', 'User-Agent:Webastra', 'SOAPAction:login', ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $result = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); $oXML = new SimpleXMLElement($result); $oXML->registerXPathNamespace('c', 'http://schemas.xmlsoap.org/soap/envelope/'); $oXML->registerXPathNamespace('f', 'urn:enterprise.soap.sforce.com'); $metadata1 = $oXML->xpath('//f:serverUrl'); $metadata2 = $oXML->xpath('//f:sessionId'); $serverurl = $metadata1[0]; $sessionid = $metadata2[0]; $to = $number; $len = strlen($number); if($len >= 10) { $to = sprintf("(%s) %s-%s", substr($number, 0, 3), substr($number, 3, 3), substr($number, 6)); } //search sfid $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?> <soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:tns=\"urn:enterprise.soap.sforce.com\"> <soap:Header> <tns:SessionHeader> <tns:sessionId>".$sessionid."</tns:sessionId> </tns:SessionHeader> <tns:QueryOptions/> <tns:MruHeader> <tns:updateMru>true</tns:updateMru> </tns:MruHeader> <tns:PackageVersionHeader/> </soap:Header> <soap:Body> <tns:query> <tns:queryString>select Id,Stips_Agent__c,F9LO__c,Owner.Name,F9Retention_Agent__c from Lead where Phone like '%".$to."%' OR Phone like '%".$number."%'</tns:queryString> </tns:query> </soap:Body> </soap:Envelope>"; $headers = array( 'Content-Type:text/xml; charset=utf-8', 'User-Agent:Webastra', 'SOAPAction:""', ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $serverurl); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLINFO_HEADER_OUT, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $result = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); $oXML = new SimpleXMLElement($result); $oXML->registerXPathNamespace('c', 'http://schemas.xmlsoap.org/soap/envelope/'); $oXML->registerXPathNamespace('d', 'urn:enterprise.soap.sforce.com'); $oXML->registerXPathNamespace('f', 'urn:sobject.enterprise.soap.sforce.com'); $metadata1 = $oXML->xpath('//f:Id'); $metadata2 = $oXML->xpath('//f:Stips_Agent__c'); $metadata3 = $oXML->xpath('//f:F9LO__c'); $metadata4 = $oXML->xpath('//f:F9Retention_Agent__c'); $sfid = $metadata1[0]; $sa = $metadata2[0]; $lo = $metadata3[0]; $ra = $metadata4[0]; $leadfield = ''; $agenturi=''; if(strlen($sfid) > 0) { if(strlen($ra) != 0) { $leadfield = $ra; } else if(strlen($sa) != 0) { $leadfield = $sa; } else if(strlen($lo) != 0) { $leadfield = $lo; } } if(strlen($leadfield) != 0) { while ($val1 = current($arrayleadurimap)) { if ($val1==$leadfield) { $agenturi = key($arrayleadurimap); break; } next($arrayleadurimap); } } if(strlen($agenturi) != 0) { print 'call='.$agenturi.',sfid='.$sfid; } else { print 'prom=,result='.$result; } } catch(Exception $e) { echo $e; } ob_flush(); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14, 8.5.0
Warning: Undefined array key "username" in /in/3R4Xr on line 36 Warning: Undefined array key "password" in /in/3R4Xr on line 37 Warning: Undefined array key "number" in /in/3R4Xr on line 38 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/3R4Xr:63 Stack trace: #0 {main} thrown in /in/3R4Xr on line 63
Process exited with code 255.
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.
Output for 8.3.28
/bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.3.28) /bin/php-8.3.28: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.3.28)
Process exited with code 1.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
Notice: Undefined index: username in /in/3R4Xr on line 36 Notice: Undefined index: password in /in/3R4Xr on line 37 Notice: Undefined index: number in /in/3R4Xr on line 38 Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/3R4Xr:63 Stack trace: #0 {main} thrown in /in/3R4Xr on line 63
Process exited with code 255.
Output for 7.3.32 - 7.3.33, 7.4.26
Fatal error: Uncaught Error: Call to undefined function curl_init() in /in/3R4Xr:63 Stack trace: #0 {main} thrown in /in/3R4Xr on line 63
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Notice: Undefined index: username in /in/3R4Xr on line 36 Notice: Undefined index: password in /in/3R4Xr on line 37 Notice: Undefined index: number in /in/3R4Xr on line 38 Fatal error: Call to undefined function curl_init() in /in/3R4Xr on line 63
Process exited with code 255.
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17
Notice: Undefined index: username in /in/3R4Xr on line 36 Notice: Undefined index: password in /in/3R4Xr on line 37 Notice: Undefined index: number in /in/3R4Xr on line 38 Fatal error: Call to undefined function curl_init() in /in/3R4Xr on line 63
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '{' in /in/3R4Xr on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1
Parse error: parse error, unexpected '{' in /in/3R4Xr on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3R4Xr on line 11
Process exited with code 255.

preferences:
187.32 ms | 423 KiB | 5 Q