3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exit = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body ><GetReadingsResponse xmlns='http://tempuri.org/'><GetReadingsResult xmlns:a='ht tp://schemas.datacontract.org/2004/07/SACObjects.Common.ObjectModel' xmlns:i='ht tp://www.w3.org/2001/XMLSchema-instance'><a:Lettura><a:CODUTE>456</a:CODUTE><a:D 1F1>12343</a:D1F1><a:D1F2>-1.7976931348623157E+308</a:D1F2><a:D1F3>-1.7976931348 623157E+308</a:D1F3><a:DMAX i:nil='true'/><a:DMIN i:nil='true'/><a:DNAH i:nil='t rue'/><a:DNAL i:nil='true'/><a:DTCL>2015-11-25T00:00:00</a:DTCL><a:DTE>2015-11-2 5T06:00:00</a:DTE><a:DTFH i:nil='true'/><a:DTFL i:nil='true'/><a:DVAR i:nil='tru e'/><a:FST>Ok</a:FST><a:IDL>0</a:IDL><a:LEG>OraLegale</a:LEG><a:NFA>0</a:NFA><a: SENT>N</a:SENT><a:TLE>Giornaliera</a:TLE><a:TYPL>Tot_Vb_g</a:TYPL></a:Lettura></ GetReadingsResult></GetReadingsResponse></s:Body></s:Envelope>"; str_replace ("<a:", '<', $exit); str_replace ("</a:", "</", $exit); $find1 = "Lettura>"; $find2 = "/Lettura>"; $pos = strpos($exit,$find1); echo $pos,"\n"; $sub= substr($exit,intval($find1),strlen($exit)-($find1-1)-($find2)); echo $sub; ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
278 Fatal error: Uncaught TypeError: Unsupported operand types: string - int in /in/MkL6N:19 Stack trace: #0 {main} thrown in /in/MkL6N on line 19
Process exited with code 255.
Output for 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33
278 Warning: A non-numeric value encountered in /in/MkL6N on line 19 Warning: A non-numeric value encountered in /in/MkL6N on line 19 <s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body ><GetReadingsResponse xmlns='http://tempuri.org/'><GetReadingsResult xmlns:a='ht tp://schemas.datacontract.org/2004/07/SACObjects.Common.ObjectModel' xmlns:i='ht tp://www.w3.org/2001/XMLSchema-instance'><a:Lettura><a:CODUTE>456</a:CODUTE><a:D 1F1>12343</a:D1F1><a:D1F2>-1.7976931348623157E+308</a:D1F2><a:D1F3>-1.7976931348 623157E+308</a:D1F3><a:DMAX i:nil='true'/><a:DMIN i:nil='true'/><a:DNAH i:nil='t rue'/><a:DNAL i:nil='true'/><a:DTCL>2015-11-25T00:00:00</a:DTCL><a:DTE>2015-11-2 5T06:00:00</a:DTE><a:DTFH i:nil='true'/><a:DTFL i:nil='true'/><a:DVAR i:nil='tru e'/><a:FST>Ok</a:FST><a:IDL>0</a:IDL><a:LEG>OraLegale</a:LEG><a:NFA>0</a:NFA><a: SENT>N</a:SENT><a:TLE>Giornaliera</a:TLE><a:TYPL>Tot_Vb_g</a:TYPL></a:Lettura></ GetReadingsResult></GetReadingsResponse></s:Body></s:Envelope>
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20
278 <s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body ><GetReadingsResponse xmlns='http://tempuri.org/'><GetReadingsResult xmlns:a='ht tp://schemas.datacontract.org/2004/07/SACObjects.Common.ObjectModel' xmlns:i='ht tp://www.w3.org/2001/XMLSchema-instance'><a:Lettura><a:CODUTE>456</a:CODUTE><a:D 1F1>12343</a:D1F1><a:D1F2>-1.7976931348623157E+308</a:D1F2><a:D1F3>-1.7976931348 623157E+308</a:D1F3><a:DMAX i:nil='true'/><a:DMIN i:nil='true'/><a:DNAH i:nil='t rue'/><a:DNAL i:nil='true'/><a:DTCL>2015-11-25T00:00:00</a:DTCL><a:DTE>2015-11-2 5T06:00:00</a:DTE><a:DTFH i:nil='true'/><a:DTFL i:nil='true'/><a:DVAR i:nil='tru e'/><a:FST>Ok</a:FST><a:IDL>0</a:IDL><a:LEG>OraLegale</a:LEG><a:NFA>0</a:NFA><a: SENT>N</a:SENT><a:TLE>Giornaliera</a:TLE><a:TYPL>Tot_Vb_g</a:TYPL></a:Lettura></ GetReadingsResult></GetReadingsResponse></s:Body></s:Envelope>

preferences:
156.42 ms | 404 KiB | 183 Q