3v4l.org

run code in 300+ PHP versions simultaneously
<?php class FileDumper { private $filename; public function __construct($filename) { $this->filename = $filename; } public function dump() { file_put_contents($this->filename); } // // Below is basically what Macroable does // private $macros = []; public function macro($name, $callable) { $this->macros[$name] = $callable; } public function __call($name, $arguments) { return call_user_func_array($this->macros[$name], $arguments); } } $exampleFileDumper = new FileDumper('/foo/bar.txt'); echo serialize($exampleFileDumper); // The plain, unedited FileDumper object // This is the one we tampered with $serialized = 'O:10:"FileDumper":2:{s:20:"FileDumperfilename";s:11:"/etc/passwd";s:18:"FileDumpermacros";a:1:{s:4:"open";a:2:{i:0;r:1;i:1;s:4:"dump";}}}'; /* Neatly formatted with explanations: O:10:"FileDumper":2:{ # instance of FileDumper class with 2 properties s:20:"FileDumperfilename"; # property "filename" on "FileDumper" s:11:"/etc/passwd"; # altered to "/etc/passwd" - note the different length s:18:"FileDumpermacros"; # property "macros" on "FileDumper" - this was empty before, but we added something to it a:1:{ # it's an array with one element s:4:"open"; # under the key "open": a:2:{ # an array with 2 elements i:0; # under key 0: r:1; # a reference to the object itself (essentially just $this) i:1; # and under key 1: s:4:"dump"; # the string "dump" } } } */ $modifiedDumper = unserialize($serialized); $modifiedDumper->open();

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.3.60.0150.00618.68
8.3.50.0130.00718.32
8.3.40.0000.01518.83
8.3.30.0080.00818.79
8.3.20.0050.00320.15
8.3.10.0000.00823.39
8.3.00.0090.00418.04
8.2.180.0070.00718.48
8.2.170.0120.00822.96
8.2.160.0030.01020.45
8.2.150.0030.00524.18
8.2.140.0030.00624.66
8.2.130.0100.00026.16
8.2.120.0080.00021.07
8.2.110.0070.00422.02
8.2.100.0030.00917.84
8.2.90.0050.00319.05
8.2.80.0080.00017.97
8.2.70.0050.00317.80
8.2.60.0030.00517.78
8.2.50.0060.00318.10
8.2.40.0040.00420.47
8.2.30.0040.00419.17
8.2.20.0000.00818.00
8.2.10.0050.00218.02
8.2.00.0030.00518.31
8.1.280.0090.00625.92
8.1.270.0040.00422.00
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0060.00322.70
8.1.230.0080.00419.00
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0030.00517.38
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0000.00818.65
8.1.160.0050.00218.85
8.1.150.0040.00420.29
8.1.140.0040.00417.57
8.1.130.0030.00718.95
8.1.120.0040.00417.39
8.1.110.0070.00017.37
8.1.100.0000.00717.40
8.1.90.0040.00417.44
8.1.80.0000.00817.43
8.1.70.0040.00417.32
8.1.60.0050.00317.50
8.1.50.0040.00417.53
8.1.40.0080.00017.49
8.1.30.0030.00517.71
8.1.20.0030.00517.66
8.1.10.0070.00017.51
8.1.00.0060.00317.57
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0030.00618.49
8.0.270.0030.00317.22
8.0.260.0030.00316.91
8.0.250.0070.00017.04
8.0.240.0000.00717.07
8.0.230.0030.00316.99
8.0.220.0020.00516.90
8.0.210.0080.00016.93
8.0.200.0070.00016.97
8.0.190.0030.00616.98
8.0.180.0060.00316.99
8.0.170.0040.00416.91
8.0.160.0000.00816.92
8.0.150.0000.00716.87
8.0.140.0040.00416.78
8.0.130.0030.00313.35
8.0.120.0040.00416.91
8.0.110.0030.00616.94
8.0.100.0040.00416.96
8.0.90.0000.00816.79
8.0.80.0060.01016.83
8.0.70.0060.00316.78
8.0.60.0000.00816.97
8.0.50.0040.00416.95
8.0.30.0100.00817.03
8.0.20.0120.00717.40
8.0.10.0040.00416.93
8.0.00.0130.01216.90
7.4.330.0000.00615.55
7.4.320.0000.00616.56
7.4.300.0070.00016.54
7.4.290.0030.00316.63
7.4.280.0000.00716.37
7.4.270.0000.00716.63
7.4.260.0000.00816.59
7.4.250.0000.00716.61
7.4.240.0040.00416.58
7.4.230.0070.00016.66
7.4.220.0070.00016.72
7.4.210.0060.00816.58
7.4.200.0000.00716.57
7.4.160.0110.00616.48
7.4.150.0120.00617.40
7.4.140.0060.01217.86
7.4.130.0130.00816.40
7.4.120.0110.00816.51
7.4.110.0080.00816.66
7.4.100.0060.01016.74
7.4.90.0100.01316.61
7.4.80.0120.01319.39
7.4.70.0030.01416.67
7.4.60.0090.01216.63
7.4.50.0060.00916.48
7.4.40.0120.00416.59
7.4.00.0060.01014.76
7.3.330.0050.00013.36
7.3.320.0000.00513.26
7.3.310.0040.00416.27
7.3.300.0030.00316.40
7.3.290.0040.01016.37
7.3.280.0080.00916.38
7.3.270.0130.00417.40
7.3.260.0110.00816.42
7.3.240.0100.00916.48
7.3.230.0150.00616.48
7.3.210.0100.00716.60
7.3.200.0120.00416.40
7.3.190.0090.00616.49
7.3.180.0130.00316.39
7.3.170.0060.01016.54
7.3.160.0080.00816.36
7.3.120.0060.00914.97
7.3.110.0070.00814.50
7.3.100.0050.01214.76
7.3.90.0050.01014.88
7.3.80.0050.01014.68
7.3.70.0040.00814.62
7.3.60.0110.00514.72
7.3.50.0080.00614.61
7.3.40.0030.00814.56
7.3.30.0020.01414.72
7.3.20.0090.00316.74
7.3.10.0100.00216.51
7.3.00.0030.00916.49
7.2.330.0030.01416.73
7.2.320.0070.01016.66
7.2.310.0090.00916.32
7.2.300.0130.00716.32
7.2.290.0060.00916.74
7.2.250.0110.00315.13
7.2.240.0110.00714.82
7.2.230.0020.01314.84
7.2.220.0030.01114.96
7.2.210.0030.01014.99
7.2.200.0080.00514.97
7.2.190.0070.00514.94
7.2.180.0070.00814.97
7.2.170.0020.01115.04
7.2.160.0080.00815.06
7.2.150.0000.01416.85
7.2.140.0100.00717.01
7.2.130.0030.01416.72
7.2.120.0070.01016.64
7.2.110.0080.00816.67
7.2.100.0060.00616.84
7.2.90.0120.00616.92
7.2.80.0030.01116.91
7.2.70.0070.00716.67
7.2.60.0050.00816.86
7.2.50.0110.00716.73
7.2.40.0000.01616.77
7.2.30.0110.00416.68
7.2.20.0310.00717.57
7.2.10.0180.01417.15
7.2.00.0200.01217.22
7.1.330.0040.01015.69
7.1.320.0040.00915.83
7.1.310.0070.00915.79
7.1.300.0050.01015.51
7.1.290.0040.00815.75
7.1.280.0030.00615.73
7.1.270.0090.00215.70
7.1.260.0060.00615.54
7.1.250.0030.00615.32
7.1.200.0040.00815.91
7.1.140.0310.01016.38
7.1.130.0250.01416.62
7.1.120.0360.01216.84
7.1.110.0370.01316.35
7.1.100.0370.01015.72
7.1.90.0280.00316.22
7.1.80.0190.01515.79
7.1.70.0390.00415.20
7.1.60.0380.00733.18
7.1.50.0290.01532.64
7.1.40.0500.01032.61
7.1.30.0400.00732.77
7.1.20.0360.00732.61
7.1.10.0230.00814.93
7.1.00.0180.01215.03

preferences:
45.42 ms | 400 KiB | 5 Q