3v4l.org

run code in 300+ PHP versions simultaneously
<?php // used namespaces, the keys do NOT need to match the prefixes in the XML. $xmlns = [ 'soap' => 'http://schemas.xmlsoap.org/soap/envelope/', 'eb' => 'http://www.ebxml.org/namespaces/messageHeader', 'sec' => 'http://schemas.xmlsoap.org/ws/2002/12/secext' ]; $document = new DOMDocument(); $document->loadXML(getSoapXmlString()); $xpath = new DOMXpath($document); // register your aliases for the namespaces foreach ($xmlns as $alias => $uri) { $xpath->registerNamespace($alias, $uri); } $token = $xpath->evaluate( 'string(//sec:Security/sec:BinarySecurityToken)' ); var_dump($token); function getSoapXmlString() { return <<<'XML' <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <soap-env:Header> <eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1"> <eb:From> <eb:PartyId eb:type="URI">Sabre_API</eb:PartyId> </eb:From> <eb:To> <eb:PartyId eb:type="URI">Agency</eb:PartyId> </eb:To> <eb:ConversationId>2021.01.DevStudio</eb:ConversationId> <eb:Service eb:type="sabreXML">Session</eb:Service> <eb:Action>TokenCreateRS</eb:Action> <eb:MessageData> <eb:MessageId>1913771794839350290</eb:MessageId> <eb:Timestamp>2023-02-23T22:04:43</eb:Timestamp> </eb:MessageData> </eb:MessageHeader> <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"> <wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">T1RLAQLASo74A7olKG7QnepeFqs19UHX+0Cds9QiDZoYfu677xC3Vkr9a+OcQhutjPL4atVMAADQRtHIXdehGg/0OVuPdia/0cM233jFDvyJJHgJHC3o8gV2ssS63b4Y0lgCG59SiG4tmEcqAXcYAMlnq+wJ4TfsOIDFwYdP+D0peSEFBM/m3EyOUqc4idJ+vO4S7xENCeQ7UX4YVKjVLJs788omPDbSIRNo85KQ5QxRprldV0jucJpAtbNfs1DrMHFqNIPyg0CpVpgXILkFx0azkcAuvmbHMHLqqO13WJEOhsG0KDBhBhRn8CwoCgD9foXL24W6yGu8Ecm0Fzvb/MuAjuYm9s48yg**</wsse:BinarySecurityToken> </wsse:Security> </soap-env:Header> <soap-env:Body> <sws:TokenCreateRS xmlns:sws="http://webservices.sabre.com" Version="1.0.0"> <sws:Success/> </sws:TokenCreateRS> </soap-env:Body> </soap-env:Envelope> XML; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.5.00.0110.01120.05
8.4.150.0030.00014.05
8.4.140.0110.01018.04
8.4.130.0080.01218.22
8.4.120.0100.01020.82
8.4.110.0080.01222.53
8.4.100.0100.01018.06
8.4.90.0160.00618.25
8.4.80.0060.00318.20
8.4.70.0060.01018.11
8.4.60.0150.00619.23
8.4.50.0060.01019.80
8.4.40.0040.01224.21
8.4.30.0030.00619.05
8.4.20.0200.00018.17
8.4.10.0130.00723.90
8.3.280.0090.01120.53
8.3.270.0100.01016.89
8.3.260.0120.00717.19
8.3.250.0090.01119.63
8.3.240.0100.00416.95
8.3.230.0090.01017.25
8.3.220.0130.00617.48
8.3.210.0120.00317.07
8.3.200.0060.00317.02
8.3.190.0060.00216.93
8.3.180.0120.00716.94
8.3.170.0070.01119.33
8.3.160.0040.00417.10
8.3.150.0090.00920.91
8.3.140.0090.00919.14
8.3.130.0060.01018.69
8.3.120.0090.00919.34
8.3.110.0050.00520.94
8.3.100.0120.00924.06
8.3.90.0090.00626.77
8.3.80.0090.00319.36
8.3.70.0070.00718.53
8.3.60.0140.00718.55
8.3.50.0140.00718.65
8.3.40.0060.00824.17
8.3.30.0100.01019.19
8.3.20.0050.00224.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.290.0120.00720.75
8.2.280.0070.00317.01
8.2.270.0150.00316.97
8.2.260.0070.00720.89
8.2.250.0120.00316.91
8.2.240.0030.00617.78
8.2.230.0060.00322.58
8.2.220.0060.00337.54
8.2.210.0160.00326.77
8.2.200.0110.00018.88
8.2.190.0090.00618.43
8.2.180.0070.00717.25
8.2.170.0060.00919.06
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0100.01024.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0100.00022.54
8.2.100.0070.00319.46
8.2.30.0020.00617.95
8.1.330.0140.00720.33
8.1.320.0100.01116.51
8.1.310.0080.00017.17
8.1.300.0070.01119.05
8.1.290.0060.00330.84
8.1.280.0220.00325.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0000.01120.77
8.1.230.0040.00419.00

preferences:
33.11 ms | 403 KiB | 5 Q