3v4l.org

run code in 300+ PHP versions simultaneously
<?php $fruits = array( "apple" => "yummy", "orange" => "ah ya, nice", "grape" => "wow, I love it!", "plum" => "nah, not me" ); $obj = new ArrayObject( $fruits ); $it = $obj->getIterator(); // How many items are we iterating over? echo "Iterating over: " . $obj->count() . " values\n"; // Iterate over the values in the ArrayObject: while( $it->valid() ) { echo $it->key() . "=" . $it->current() . "\n"; $it->next(); } // The good thing here is that it can be iterated with foreach loop foreach ($it as $key=>$val) echo $key.":".$val."\n"; /* Outputs something like */ Iterating over: 4 values apple=yummy orange=ah ya, nice grape=wow, I love it! plum=nah, not me ?>

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)
5.4.220.0180.06712.38
5.4.210.0150.04112.38
5.4.200.0100.04612.38
5.4.190.0120.04112.37
5.4.180.0120.04612.37
5.4.170.0150.04012.38
5.4.160.0140.04312.38
5.4.150.0110.04112.37
5.4.140.0090.04712.06
5.4.130.0130.03912.04
5.4.120.0130.03612.01
5.4.110.0300.05412.01
5.4.100.0120.04212.00
5.4.90.0100.04312.01
5.4.80.0100.04112.00
5.4.70.0180.06112.00
5.4.60.0110.04212.01
5.4.50.0090.04312.00
5.4.40.0130.03811.99
5.4.30.0130.04211.99
5.4.20.0130.05111.98
5.4.10.0140.03911.99
5.4.00.0130.04311.48
5.3.270.0120.04312.72
5.3.260.0120.04312.72
5.3.250.0100.04212.72
5.3.240.0200.06512.72
5.3.230.0120.04212.71
5.3.220.0140.04012.68
5.3.210.0100.04712.68
5.3.200.0120.04012.68
5.3.190.0210.06612.67
5.3.180.0150.03812.68
5.3.170.0100.04312.67
5.3.160.0250.06012.67
5.3.150.0120.04112.67
5.3.140.0140.04112.66
5.3.130.0110.04712.66
5.3.120.0200.07212.66
5.3.110.0130.04512.66
5.3.100.0150.04112.12
5.3.90.0120.03912.08
5.3.80.0280.05612.07
5.3.70.0110.04312.08
5.3.60.0140.04012.06
5.3.50.0130.04512.00
5.3.40.0100.04812.00
5.3.30.0230.05911.95
5.3.20.0120.03911.72
5.3.10.0150.06511.69
5.3.00.0120.03911.67

preferences:
139.18 ms | 1394 KiB | 7 Q