3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { static function cast(&$val, $key) { if (is_numeric($val)) { //return $val + 0; $val += 0; } //return 0; //return $val; } static run() { $arr = ['stri33ng123', 84, 76.7, '45.6', '67.5e45', '56,9']; var_dump($arr); array_walk($arr , 'cast'); var_dump($arr); } }

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.0220.06812.39
5.4.210.0130.03812.39
5.4.200.0140.03912.39
5.4.190.0110.04412.39
5.4.180.0140.03912.39
5.4.170.0110.04312.39
5.4.160.0120.04312.39
5.4.150.0120.04312.39
5.4.140.0130.04312.08
5.4.130.0120.04212.06
5.4.120.0140.04212.03
5.4.110.0120.04112.02
5.4.100.0110.04212.02
5.4.90.0210.06012.02
5.4.80.0140.03612.02
5.4.70.0110.03812.02
5.4.60.0210.06012.02
5.4.50.0130.03812.02
5.4.40.0150.03512.01
5.4.30.0130.03912.00
5.4.20.0120.04112.00
5.4.10.0100.04612.00
5.4.00.0140.04411.49
5.3.270.0120.04312.72
5.3.260.0150.05612.72
5.3.250.0130.04212.72
5.3.240.0110.04512.72
5.3.230.0290.06012.71
5.3.220.0140.03912.68
5.3.210.0150.04912.68
5.3.200.0140.05212.68
5.3.190.0140.05412.67
5.3.180.0140.04712.67
5.3.170.0140.04912.67
5.3.160.0130.04912.67
5.3.150.0240.06912.67
5.3.140.0120.04712.66
5.3.130.0140.04312.65
5.3.120.0200.05312.66
5.3.110.0120.04612.66
5.3.100.0130.04312.12
5.3.90.0150.03912.10
5.3.80.0110.04512.08
5.3.70.0120.04712.08
5.3.60.0110.04712.07
5.3.50.0120.04712.01
5.3.40.0210.06512.01
5.3.30.0150.04411.97
5.3.20.0140.03811.75
5.3.10.0090.04011.72
5.3.00.0100.03911.70

preferences:
147.04 ms | 1394 KiB | 7 Q