3v4l.org

run code in 300+ PHP versions simultaneously
<?php class c1 { public $a = 1; public $b = 2; } class c2 implements Serializable { public $a = 1; public $b = 2; public function serialize() { return 's:1:"a";i:1;s:1:"b";i:2;'; } public function unserialize($str) { $this->a = 3; } public __wakeup() { echo $this->a; } } $o1 = new c1; $o2 = new c2; echo $o_str = serialize($o1) . "\n"; echo $c_str = serialize($o2) . "\n"; $o_str = str_replace($o_str, "c1", "c2"); $o1 = unserialize($o_str); $o2 = unserialize($c_str);

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.170.0230.05312.39
5.4.160.0160.04312.39
5.4.150.0140.04412.38
5.4.140.0160.04312.07
5.4.130.0190.03912.05
5.4.120.0190.03912.02
5.4.110.0150.04412.01
5.4.100.0170.04412.01
5.4.90.0210.05212.01
5.4.80.0160.04212.02
5.4.70.0230.05012.01
5.4.60.0160.04212.01
5.4.50.0190.03912.01
5.4.40.0160.04312.00
5.4.30.0210.05412.00
5.4.20.0160.04311.99
5.4.10.0170.04212.00
5.4.00.0230.04811.48
5.3.270.0160.04512.73
5.3.260.0180.04612.72
5.3.250.0200.04212.72
5.3.240.0200.04412.72
5.3.230.0290.06512.71
5.3.220.0210.04212.68
5.3.210.0190.04412.68
5.3.200.0180.04412.68
5.3.190.0150.04612.68
5.3.180.0160.04412.67
5.3.170.0190.04312.67
5.3.160.0160.04612.68
5.3.150.0240.06612.67
5.3.140.0180.04312.66
5.3.130.0170.04312.66
5.3.120.0210.04112.66
5.3.110.0130.04812.66
5.3.100.0200.04212.12
5.3.90.0150.04312.10
5.3.80.0250.06412.09
5.3.70.0180.04312.09
5.3.60.0160.04512.07
5.3.50.0140.04812.02
5.3.40.0230.06812.02
5.3.30.0160.04211.99
5.3.20.0140.04411.77
5.3.10.0140.04211.73
5.3.00.0120.04511.71

preferences:
139.99 ms | 939 KiB | 8 Q