3v4l.org

run code in 300+ PHP versions simultaneously
<?php class StringSupported { protected $value; public function __construct(string $string) { $this->value = $string; } public function __toString() { return $this->value; } } class Token { public function replace($text) { if (is_object($text)) { throw new \TypeError("Argument $text expected type string, Object passed"); } echo sprintf('you passed %s', $text); } } $token = new Token(); $token->replace('bob'); $token->replace(new StringSupported('bess'));

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.4.120.0130.01122.74
8.4.110.0110.01022.34
8.4.100.0120.00817.74
8.4.90.0100.01019.04
8.4.80.0120.00917.86
8.4.70.0110.00918.06
8.4.60.0070.00518.73
8.4.50.0110.00919.92
8.4.40.0100.00918.14
8.4.30.0060.00920.63
8.4.20.0170.00317.87
8.4.10.0080.00817.86
8.3.250.0050.00518.88
8.3.240.0140.00616.91
8.3.230.0050.00316.77
8.3.220.0120.00717.41
8.3.210.0110.00716.85
8.3.200.0050.00416.81
8.3.190.0050.00417.32
8.3.180.0060.01016.54
8.3.170.0100.01318.89
8.3.160.0130.00616.66
8.3.150.0080.00020.80
8.3.140.0040.01416.66
8.3.130.0070.00716.91
8.3.120.0100.01018.79
8.3.110.0050.00320.94
8.3.100.0090.00024.06
8.3.90.0060.00326.77
8.3.80.0060.00616.63
8.3.70.0150.00016.63
8.3.60.0090.00918.81
8.3.50.0070.00718.05
8.3.40.0100.01021.86
8.3.30.0090.00618.66
8.3.20.0080.00024.18
8.3.10.0070.00024.66
8.3.00.0030.00626.16
8.2.290.0110.00820.63
8.2.280.0040.00618.36
8.2.270.0100.01018.83
8.2.260.0040.01118.55
8.2.250.0050.00316.63
8.2.240.0040.00418.92
8.2.230.0080.00022.58
8.2.220.0090.00937.54
8.2.210.0040.00426.77
8.2.200.0090.00016.63
8.2.190.0120.00616.88
8.2.180.0150.00025.92
8.2.170.0180.00418.89
8.2.160.0130.00322.96
8.2.150.0000.00925.66
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0070.00026.16
8.2.110.0040.00419.26
8.2.100.0090.00318.16
8.2.90.0060.00317.75
8.2.80.0050.00317.97
8.2.70.0060.00318.05
8.2.60.0050.00318.09
8.2.50.0080.00017.55
8.2.40.0060.00319.48
8.2.30.0040.00417.68
8.2.20.0030.00517.97
8.2.10.0030.00619.12
8.2.00.0040.00419.30
8.1.330.0140.00421.80
8.1.320.0140.00616.45
8.1.310.0100.01016.70
8.1.300.0120.00316.02
8.1.290.0050.00518.88
8.1.280.0080.00825.92
8.1.270.0060.00323.99
8.1.260.0000.00726.35
8.1.250.0050.00328.09
8.1.240.0090.00317.35
8.1.230.0040.00717.77
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0000.00917.47
8.1.190.0040.00417.35
8.1.180.0030.00618.10
8.1.170.0000.00718.87
8.1.160.0030.00618.96
8.1.150.0070.00018.55
8.1.140.0050.00318.91
8.1.130.0050.00218.96
8.1.120.0030.00317.53
8.1.110.0030.00317.42
8.1.100.0070.00017.46
8.1.90.0040.00417.48
8.1.80.0030.00717.40
8.1.70.0030.00317.46
8.1.60.0000.00817.65
8.1.50.0030.00617.52
8.1.40.0000.00817.56
8.1.30.0000.00817.67
8.1.20.0040.00417.64
8.1.10.0070.00417.48
8.1.00.0050.00217.37
8.0.300.0040.00418.77
8.0.290.0000.00816.88
8.0.280.0000.00717.95
8.0.270.0030.00516.88
8.0.260.0030.00318.55
8.0.250.0080.00017.02
8.0.240.0000.00717.06
8.0.230.0000.00716.89
8.0.220.0020.00516.98
8.0.210.0040.00417.00
8.0.200.0040.00416.99
8.0.190.0080.00017.01
8.0.180.0080.00316.88
8.0.170.0030.00516.98
8.0.160.0030.00617.01
8.0.150.0050.00316.97
8.0.140.0050.00316.97
8.0.130.0030.00313.41
8.0.120.0060.00316.91
8.0.110.0040.00416.94
8.0.100.0020.00616.81
8.0.90.0030.00516.90
8.0.80.0040.00416.91
8.0.70.0050.00316.95
8.0.60.0040.00316.94
8.0.50.0000.00817.00
8.0.30.0030.00516.94
8.0.20.0030.00517.03
8.0.10.0010.00617.11
8.0.00.0010.00717.08
7.4.330.0060.00015.55
7.4.320.0040.00416.54
7.4.300.0030.00316.52
7.4.290.0000.00816.55
7.4.280.0070.00016.49
7.4.270.0050.00316.60
7.4.260.0060.00013.33
7.4.250.0030.00316.48
7.4.240.0000.00716.61
7.4.230.0030.00516.53
7.4.220.0020.00616.39
7.4.210.0020.00516.50
7.4.200.0000.00716.53
7.4.190.0060.00116.56
7.4.180.0000.00716.46
7.4.160.0040.00416.55
7.4.150.0000.00716.47
7.4.140.0040.00316.41
7.4.130.0030.00416.59
7.4.120.0040.00416.41
7.4.110.0020.00516.49
7.4.100.0020.00616.38
7.4.90.0050.00216.38
7.4.80.0040.00316.36
7.4.70.0020.00516.41
7.4.60.0000.00716.48
7.4.50.0040.00416.50
7.4.40.0050.00216.33
7.4.30.0020.00516.28
7.4.20.0020.00616.53
7.4.10.0040.00416.36
7.4.00.0020.00616.32
7.3.330.0040.00416.43
7.3.320.0000.00513.46
7.3.310.0030.00316.46
7.3.300.0010.00716.26
7.3.290.0040.00416.40
7.3.280.0030.00416.37
7.3.270.0020.00616.44
7.3.260.0030.00416.36
7.3.250.0020.00516.31
7.3.240.0020.00616.29
7.3.230.0000.00716.37
7.3.220.0020.00616.22
7.3.210.0030.00416.30
7.3.200.0040.00416.41
7.3.190.0020.00516.32
7.3.180.0050.00216.23
7.3.170.0020.00516.33
7.3.160.0030.00416.36
7.3.150.0000.00816.26
7.3.140.0050.00216.25
7.3.130.0000.00716.32
7.3.120.0060.00116.24
7.3.110.0030.00516.22
7.3.100.0020.00616.17
7.3.90.0040.00416.61
7.3.80.0020.00616.30
7.3.70.0040.00316.31
7.3.60.0020.00516.48
7.3.50.0020.00616.48
7.3.40.0010.00616.44
7.3.30.0020.00516.48
7.3.20.0030.00416.37
7.3.10.0040.00416.28
7.3.00.0040.00316.38

preferences:
28.65 ms | 403 KiB | 5 Q