3v4l.org

run code in 300+ PHP versions simultaneously
<?php $contents = <<<'PHP' <?php class AClass { public function aMethod() { \$test = true;# a comment } } PHP; $output = ''; foreach (token_get_all($contents) as $token) { if (is_string($token)) { $output .= $token; } elseif (in_array($token[0], [T_COMMENT, T_DOC_COMMENT], true)) { var_dump($token[1]); } elseif (T_WHITESPACE === $token[0]) { var_dump($token[1]); } else { $output .= $token[1]; } }

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.5.00.0140.00719.85
8.4.150.0020.00114.05
8.4.140.0140.00717.58
8.4.130.0140.00717.69
8.4.120.0070.01020.36
8.4.110.0110.01022.33
8.4.100.0130.00718.65
8.4.90.0140.00720.41
8.4.80.0060.00218.49
8.4.70.0100.00117.77
8.4.60.0110.01018.93
8.4.50.0090.01122.43
8.4.40.0160.00317.82
8.4.30.0100.01020.38
8.4.20.0030.00619.63
8.4.10.0060.00319.63
8.3.280.0110.00920.00
8.3.270.0120.01016.61
8.3.260.0130.00416.92
8.3.250.0030.00419.00
8.3.240.0090.01117.20
8.3.230.0110.01016.95
8.3.220.0090.00819.07
8.3.210.0090.01116.89
8.3.200.0020.00716.56
8.3.190.0070.00217.10
8.3.180.0100.00918.96
8.3.170.0130.00618.41
8.3.160.0140.00417.28
8.3.150.0130.00916.98
8.3.140.0090.00918.95
8.3.130.0050.00518.68
8.3.120.0050.00520.68
8.3.110.0030.00520.94
8.3.100.0030.00624.06
8.3.90.0080.00626.77
8.3.80.0050.00519.36
8.3.70.0090.00618.56
8.3.60.0090.00618.30
8.3.50.0090.00923.62
8.3.40.0110.00421.82
8.3.30.0130.00318.75
8.3.20.0030.00624.18
8.3.10.0000.00724.66
8.3.00.0030.00626.16
8.2.290.0130.00620.29
8.2.280.0120.00718.61
8.2.270.0140.00419.01
8.2.260.0130.00616.57
8.2.250.0080.00016.54
8.2.240.0040.00417.25
8.2.230.0080.00022.58
8.2.220.0150.00337.54
8.2.210.0040.00426.77
8.2.200.0040.00418.88
8.2.190.0090.00916.70
8.2.180.0070.01025.92
8.2.170.0130.00618.94
8.2.160.0110.00322.96
8.2.150.0040.00425.66
8.2.140.0090.00024.66
8.2.130.0000.00726.16
8.2.120.0060.00326.35
8.2.110.0100.00019.37
8.2.100.0170.00017.84
8.2.90.0080.00017.75
8.2.80.0090.00018.91
8.2.70.0050.00318.03
8.2.60.0050.00318.16
8.2.50.0080.00018.10
8.2.40.0000.00821.21
8.2.30.0040.00419.18
8.2.20.0000.00718.18
8.2.10.0080.00019.15
8.2.00.0040.00419.14
8.1.330.0120.01021.89
8.1.320.0130.00618.00
8.1.310.0060.00316.80
8.1.300.0040.00417.76
8.1.290.0000.00830.84
8.1.280.0160.00625.92
8.1.270.0080.00023.99
8.1.260.0080.00028.09
8.1.250.0080.00028.09
8.1.240.0070.01019.61
8.1.230.0110.00017.83
8.1.220.0090.00017.74
8.1.210.0050.00318.77
8.1.200.0060.00717.13
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0050.00318.47
8.1.160.0040.00418.92
8.1.150.0080.00018.93
8.1.140.0040.00418.73
8.1.130.0030.00320.19
8.1.120.0000.01017.49
8.1.110.0040.00417.40
8.1.100.0070.00017.52
8.1.90.0000.00917.45
8.1.80.0030.00617.48
8.1.70.0000.00717.34
8.1.60.0050.00517.61
8.1.50.0000.00817.47
8.1.40.0040.00417.44
8.1.30.0030.00617.48
8.1.20.0000.01317.64
8.1.10.0060.00317.61
8.1.00.0000.00717.39
8.0.300.0080.00018.77
8.0.290.0040.00416.88
8.0.280.0070.00018.50
8.0.270.0070.00016.85
8.0.260.0060.00018.57
8.0.250.0030.00317.03
8.0.240.0000.00616.95
8.0.230.0000.00716.90
8.0.220.0080.00016.98
8.0.210.0030.00516.92
8.0.200.0030.00317.07
8.0.190.0030.00616.90
8.0.180.0030.00316.98
8.0.170.0000.00816.98
8.0.160.0050.00217.01
8.0.150.0070.00016.80
8.0.140.0070.00316.91
8.0.130.0030.00313.34
8.0.120.0070.00016.87
8.0.110.0050.00217.02
8.0.100.0040.00416.76
8.0.90.0050.00216.98
8.0.80.0090.00716.87
8.0.70.0000.00716.75
8.0.60.0070.00016.81
8.0.50.0030.00416.73
8.0.30.0030.01317.02
8.0.20.0090.00917.04
8.0.10.0000.00916.96
8.0.00.0110.00717.13
7.4.330.0030.00315.55
7.4.320.0060.00016.64
7.4.300.0040.00416.61
7.4.290.0070.00016.56
7.4.280.0090.00016.61
7.4.270.0030.00316.52
7.4.260.0000.00513.28
7.4.250.0040.00416.57
7.4.240.0000.00716.60
7.4.230.0030.00316.40
7.4.220.0020.00616.42
7.4.210.0050.01016.59
7.4.200.0000.00716.49
7.4.130.0070.01116.44
7.4.120.0060.01416.56
7.4.110.0130.01316.65
7.4.100.0150.01116.38
7.4.90.0130.00616.39
7.4.80.0080.01316.72
7.4.70.0100.00916.57
7.4.60.0180.00016.45
7.4.50.0100.01316.32
7.4.40.0100.01316.77
7.4.30.0130.00716.55
7.4.20.0120.00916.05
7.4.10.0170.00716.38
7.4.00.0160.00716.60
7.3.330.0110.00016.17
7.3.320.0030.00313.16
7.3.310.0030.00316.39
7.3.300.0040.00416.16
7.3.290.0070.00716.30
7.3.260.0100.00716.55
7.3.250.0130.00616.21
7.3.240.0220.00016.20
7.3.230.0160.00916.32
7.3.220.0130.00616.56
7.3.210.0130.00616.50
7.3.200.0130.00616.62
7.3.190.0110.00716.43
7.3.180.0090.00916.36
7.3.170.0100.01316.49
7.3.160.0070.01316.31
7.3.150.0060.01316.53
7.3.140.0130.00616.41
7.3.130.0130.00916.39
7.3.120.0190.00016.62
7.3.110.0060.01516.44
7.3.100.0150.00916.35
7.3.90.0100.01316.48
7.3.80.0100.01316.34
7.3.70.0110.00816.15
7.3.60.0150.00816.11
7.3.50.0140.01016.30
7.3.40.0120.00916.36
7.3.30.0170.00716.30
7.3.20.0280.00716.22
7.3.10.0200.01716.41
7.3.00.0260.00616.31

preferences:
29.52 ms | 403 KiB | 5 Q