3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait theTrait { public function test($a, $x=[]) { if (isset($this->x)) { echo 'prefixed: ' . $a; } else { echo $a; } } } class theClass { use theTrait; protected $x = []; } /* class theExtend extends theClass { public function test($b) { echo 'prefixed: ' . $b; } } */ $x = new theClass; $x->test('test');

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.140.0120.01017.67
8.4.130.0120.00818.61
8.4.120.0060.00424.36
8.4.110.0110.01018.79
8.4.100.0090.01117.68
8.4.90.0100.00917.85
8.4.80.0110.01018.02
8.4.70.0120.00817.80
8.4.60.0130.00817.58
8.4.50.0120.00919.30
8.4.40.0120.00317.70
8.4.30.0130.00320.34
8.4.20.0140.00719.72
8.4.10.0060.00319.53
8.3.270.0090.01016.45
8.3.260.0060.00216.66
8.3.250.0110.00819.08
8.3.240.0160.00416.60
8.3.230.0130.00716.57
8.3.220.0080.00817.03
8.3.210.0080.00716.63
8.3.200.0170.00418.85
8.3.190.0130.00616.48
8.3.180.0120.00918.61
8.3.170.0100.00916.57
8.3.160.0140.00418.46
8.3.150.0160.00316.42
8.3.140.0040.00417.14
8.3.130.0080.00018.39
8.3.120.0060.00319.09
8.3.110.0130.00620.94
8.3.100.0000.00924.06
8.3.90.0040.00726.77
8.3.80.0090.00016.50
8.3.70.0070.00716.58
8.3.60.0130.01018.39
8.3.50.0110.00418.11
8.3.40.0140.00021.69
8.3.30.0140.00418.60
8.3.20.0000.00724.18
8.3.10.0070.00024.66
8.3.00.0050.00226.16
8.2.290.0130.00520.74
8.2.280.0080.00716.85
8.2.270.0120.00617.29
8.2.260.0000.00816.77
8.2.250.0040.00416.54
8.2.240.0060.01317.29
8.2.230.0000.01522.58
8.2.220.0080.00037.54
8.2.210.0060.00326.77
8.2.200.0040.00416.63
8.2.190.0180.00416.63
8.2.180.0090.00625.92
8.2.170.0060.00918.79
8.2.160.0150.00322.96
8.2.150.0040.00425.66
8.2.140.0100.00724.66
8.2.130.0070.00026.16
8.2.120.0030.01519.86
8.2.110.0060.00320.47
8.2.100.0040.00817.66
8.2.90.0080.00017.91
8.2.80.0060.00318.22
8.2.70.0030.00517.75
8.2.60.0040.00417.63
8.2.50.0050.00317.55
8.2.40.0050.00519.35
8.2.30.0000.00717.63
8.2.20.0080.00317.94
8.2.10.0000.00819.30
8.2.00.0040.00419.36
8.1.330.0100.00816.90
8.1.320.0080.01016.25
8.1.310.0090.00918.41
8.1.300.0090.00017.92
8.1.290.0060.00330.84
8.1.280.0060.01225.92
8.1.270.0000.00823.99
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0060.00317.48
8.1.230.0030.00722.20
8.1.220.0040.00417.76
8.1.210.0050.00318.77
8.1.200.0060.00317.22
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0040.00417.82
8.1.160.0000.00718.94
8.1.150.0000.00718.58
8.1.140.0000.00718.92
8.1.130.0040.00418.90
8.1.120.0040.00417.46
8.1.110.0050.00317.36
8.1.100.0070.00017.50
8.1.90.0040.00417.45
8.1.80.0000.01017.34
8.1.70.0040.00417.52
8.1.60.0040.00417.55
8.1.50.0040.00417.41
8.1.40.0040.00417.55
8.1.30.0090.00017.70
8.1.20.0040.00417.61
8.1.10.0120.00017.46
8.1.00.0030.00617.42
8.0.300.0050.00319.93
8.0.290.0040.00416.75
8.0.280.0000.00717.97
8.0.270.0000.00716.76
8.0.260.0000.00618.57
8.0.250.0000.00816.86
8.0.240.0030.00316.88
8.0.230.0030.00316.86
8.0.220.0070.00016.91
8.0.210.0030.00316.76
8.0.200.0040.00416.84
8.0.190.0040.00416.82
8.0.180.0030.00616.94
8.0.170.0090.00016.79
8.0.160.0040.00416.91
8.0.150.0040.00416.89
8.0.140.0070.00016.73
8.0.130.0000.00613.28
8.0.120.0080.00016.91
8.0.110.0040.00416.80
8.0.100.0000.00716.87
8.0.90.0020.00516.71
8.0.80.0050.00216.94
8.0.70.0030.00316.78
8.0.60.0020.00516.81
8.0.50.0040.00416.86
8.0.30.0020.00616.77
8.0.20.0050.00316.91
8.0.10.0050.00217.01
8.0.00.0020.00517.04
7.4.330.0050.00015.55
7.4.320.0060.00016.59
7.4.300.0000.00616.61
7.4.290.0050.00316.54
7.4.280.0080.00016.51
7.4.270.0080.00016.50
7.4.260.0040.00413.32
7.4.250.0000.00716.62
7.4.240.0040.00416.66
7.4.230.0020.00516.46
7.4.220.0050.00216.69
7.4.210.0030.00316.41
7.4.200.0020.00616.55
7.4.190.0030.00316.44
7.4.180.0030.00316.51
7.4.160.0030.00316.71
7.4.150.0030.00416.57
7.4.140.0070.00016.46
7.4.130.0040.00416.42
7.4.120.0030.00416.34
7.4.110.0030.00416.49
7.4.100.0000.00716.59
7.4.90.0020.00516.35
7.4.80.0020.00516.36
7.4.70.0020.00516.42
7.4.60.0030.00416.38
7.4.50.0050.00216.25
7.4.40.0020.00516.33
7.4.30.0010.00616.38
7.4.20.0020.00516.49
7.4.10.0070.00016.41
7.4.00.0030.00316.51
7.3.330.0040.00416.27
7.3.320.0030.00313.07
7.3.310.0000.00716.09
7.3.300.0020.00516.17
7.3.290.0000.00716.16
7.3.280.0050.00216.17
7.3.270.0020.00516.18
7.3.260.0040.00416.16
7.3.250.0000.00716.19
7.3.240.0030.00316.12
7.3.230.0040.00316.25
7.3.220.0040.00416.24
7.3.210.0010.00716.08
7.3.200.0050.00316.15
7.3.190.0020.00516.16
7.3.180.0030.00416.14
7.3.170.0030.00316.18
7.3.160.0020.00516.16
7.3.150.0050.00216.18
7.3.140.0030.00316.19
7.3.130.0030.00316.27
7.3.120.0000.00716.16
7.3.110.0020.00516.03
7.3.100.0030.00316.06
7.3.90.0040.00316.40
7.3.80.0020.00516.03
7.3.70.0070.00016.28
7.3.60.0040.00416.38
7.3.50.0020.00516.40
7.3.40.0020.00616.43
7.3.30.0010.00616.35
7.3.20.0010.00617.29
7.3.10.0000.00717.25
7.3.00.0020.00517.20
7.2.340.0000.00716.14
7.2.330.0080.00016.34
7.2.320.0070.00016.20
7.2.310.0040.00416.23
7.2.300.0070.00016.22
7.2.290.0070.00016.38
7.2.280.0030.00516.39
7.2.270.0030.00516.19
7.2.260.0040.00416.37
7.2.250.0000.00716.39
7.2.240.0070.00016.38
7.2.230.0040.00416.40
7.2.220.0000.00716.39
7.2.210.0000.00716.28
7.2.200.0030.00316.62
7.2.190.0030.00316.58
7.2.180.0000.00716.53
7.2.170.0000.00716.48
7.2.160.0030.00616.45
7.2.150.0000.00916.57
7.2.140.0080.00016.53
7.2.130.0080.00016.88
7.2.120.0040.00416.68
7.2.110.0080.00016.74
7.2.100.0060.00316.81
7.2.90.0070.00216.65
7.2.80.0040.00416.60
7.2.70.0040.00416.52
7.2.60.0000.01016.77
7.2.50.0030.00616.61
7.2.40.0050.00316.71
7.2.30.0000.00916.71
7.2.20.0000.00816.81
7.2.10.0000.00916.55
7.2.00.0000.00816.84
7.1.330.0030.00315.32
7.1.320.0050.00315.41
7.1.310.0040.00415.48
7.1.300.0040.00415.55
7.1.290.0000.00815.51
7.1.280.0070.00015.36
7.1.270.0030.00315.30
7.1.260.0040.00415.30
7.1.250.0040.00415.37
7.1.240.0000.00715.34
7.1.230.0030.00315.43
7.1.220.0070.00015.48
7.1.210.0040.00415.34
7.1.200.0000.00815.34
7.1.190.0030.00315.40
7.1.180.0030.00915.20
7.1.170.0060.00615.23
7.1.160.0030.00315.38
7.1.150.0000.00715.38
7.1.140.0060.00015.45
7.1.130.0040.00415.16
7.1.120.0030.00315.41
7.1.110.0040.00415.29
7.1.100.0000.00815.41
7.1.90.0000.00715.26
7.1.80.0030.00315.26
7.1.70.0000.00815.15
7.1.60.0030.00515.48
7.1.50.0050.00215.44
7.1.40.0070.00015.41
7.1.30.0030.00315.50
7.1.20.0030.00315.38
7.1.10.0000.00815.25
7.1.00.0000.00715.33
7.0.330.0000.00815.07
7.0.320.0040.00415.05
7.0.310.0050.00214.90
7.0.300.0150.00415.01
7.0.290.0080.00015.07
7.0.280.0040.00415.12
7.0.270.0040.00415.16
7.0.260.0000.00715.15
7.0.250.0040.00415.19
7.0.240.0000.00815.26
7.0.230.0050.00315.09
7.0.220.0050.00315.30
7.0.210.0080.00015.28
7.0.200.0040.00415.14
7.0.190.0080.00015.25
7.0.180.0080.00015.24
7.0.170.0000.00815.20
7.0.160.0080.00015.05
7.0.150.0000.00915.06
7.0.140.0030.00515.06
7.0.130.0030.00315.28
7.0.120.0000.00815.29
7.0.110.0000.00715.17
7.0.100.0030.00515.05
7.0.90.0030.00515.09
7.0.80.0070.00415.13
7.0.70.0050.00214.93
7.0.60.0070.00014.91
7.0.50.0080.00414.89
7.0.40.0000.00715.16
7.0.30.0030.00315.01
7.0.20.0070.00014.97
7.0.10.0040.00415.14
7.0.00.0070.00015.10
5.6.400.0000.00615.78
5.6.390.0040.00415.75
5.6.380.0030.00315.79
5.6.370.0030.00315.83
5.6.360.0040.00415.77
5.6.350.0050.00315.79
5.6.340.0080.00015.74
5.6.330.0030.00315.90
5.6.320.0030.00315.71
5.6.310.0040.00415.79
5.6.300.0080.00015.80
5.6.290.0040.00415.91
5.6.280.0060.00315.75
5.6.270.0030.00515.82
5.6.260.0080.00015.87
5.6.250.0050.00215.75
5.6.240.0030.00315.70
5.6.230.0070.00015.80
5.6.220.0030.00315.93
5.6.210.0000.00715.77
5.6.200.0000.00615.84
5.6.190.0070.00015.80
5.6.180.0000.00716.01
5.6.170.0040.00416.06
5.6.160.0000.00715.83
5.6.150.0060.00015.91
5.6.140.0030.00315.78
5.6.130.0030.00315.85
5.6.120.0030.00315.92
5.6.110.0070.00015.81
5.6.100.0000.00615.97
5.6.90.0000.00715.63
5.6.80.0030.00315.79
5.6.70.0040.00415.95
5.6.60.0070.00015.81
5.6.50.0000.00716.01
5.6.40.0070.00015.75
5.6.30.0000.00715.75
5.6.20.0030.00315.97
5.6.10.0040.00415.86
5.6.00.0030.00315.90
5.5.380.0040.00416.00
5.5.370.0040.00415.75
5.5.360.0070.00015.61
5.5.350.0000.00715.70
5.5.340.0060.00015.71
5.5.330.0000.00715.65
5.5.320.0050.00215.53
5.5.310.0040.00415.70
5.5.300.0000.00615.48
5.5.290.0000.00615.77
5.5.280.0030.00315.70
5.5.270.0000.00615.66
5.5.260.0030.00315.66
5.5.250.0050.00215.89
5.5.240.0050.00315.89
5.5.230.0040.00415.73
5.5.220.0000.00615.82
5.5.210.0000.00615.89
5.5.200.0060.00015.75
5.5.190.0030.00315.70
5.5.180.0050.00215.80
5.5.170.0000.00815.74
5.5.160.0000.00815.74
5.5.150.0000.00715.55
5.5.140.0030.00315.54
5.5.130.0030.00315.68
5.5.120.0060.00015.61
5.5.110.0030.00315.40
5.5.100.0060.00015.80
5.5.90.0030.00315.78
5.5.80.0060.00015.79
5.5.70.0000.00615.87
5.5.60.0070.00015.76
5.5.50.0000.00715.64
5.5.40.0070.00015.80
5.5.30.0070.00015.81
5.5.20.0070.00015.86
5.5.10.0060.00015.72
5.5.00.0030.00315.54
5.4.450.0000.00512.61
5.4.440.0030.00312.79
5.4.430.0050.00012.77
5.4.420.0000.00512.55
5.4.410.0000.00512.79
5.4.400.0000.00512.72
5.4.390.0050.00012.57
5.4.380.0050.00012.70
5.4.370.0050.00012.59
5.4.360.0060.00012.75
5.4.350.0030.00312.48
5.4.340.0050.00012.49
5.4.330.0000.00512.60
5.4.320.0000.00512.69
5.4.310.0000.00512.77
5.4.300.0050.00012.55
5.4.290.0020.00212.76
5.4.280.0000.00512.54
5.4.270.0050.00012.66
5.4.260.0000.00512.71
5.4.250.0000.00512.61
5.4.240.0000.00512.47
5.4.230.0000.00512.35
5.4.220.0050.00012.43
5.4.210.0050.00012.43
5.4.200.0000.00512.36
5.4.190.0000.00512.55
5.4.180.0000.00612.52
5.4.170.0030.00312.58
5.4.160.0000.00512.43
5.4.150.0050.00012.53
5.4.140.0050.00012.47
5.4.130.0050.00012.66
5.4.120.0000.00512.55
5.4.110.0020.00212.71
5.4.100.0050.00012.58
5.4.90.0020.00212.71
5.4.80.0060.00012.60
5.4.70.0060.00012.93
5.4.60.0000.00512.73
5.4.50.0050.00012.70
5.4.40.0000.00612.63
5.4.30.0060.00012.77
5.4.20.0070.00012.53
5.4.10.0050.00012.54
5.4.00.0030.00312.53
5.3.290.0060.00012.98
5.3.280.0050.00012.83
5.3.270.0000.00512.87
5.3.260.0000.00512.70
5.3.250.0000.00512.77
5.3.240.0000.00512.79
5.3.230.0050.00012.46
5.3.220.0000.00512.65
5.3.210.0000.00512.63
5.3.200.0000.00512.52
5.3.190.0000.00612.72
5.3.180.0000.00512.91
5.3.170.0020.00212.82
5.3.160.0000.00512.84
5.3.150.0020.00212.82
5.3.140.0000.00512.67
5.3.130.0050.00012.97
5.3.120.0000.00512.77
5.3.110.0000.00512.83
5.3.100.0020.00212.64
5.3.90.0050.00012.90
5.3.80.0050.00012.58
5.3.70.0050.00012.92
5.3.60.0000.00512.74
5.3.50.0000.00512.55
5.3.40.0020.00212.69
5.3.30.0050.00012.66
5.3.20.0000.00612.67
5.3.10.0030.00312.58
5.3.00.0060.00012.48
5.2.170.0000.00611.78
5.2.160.0030.00311.78
5.2.150.0030.00311.98
5.2.140.0000.00511.74
5.2.130.0000.00411.79
5.2.120.0000.00511.72
5.2.110.0040.00011.93
5.2.100.0000.00611.79
5.2.90.0030.00311.93
5.2.80.0000.00511.55
5.2.70.0050.00011.54
5.2.60.0040.00011.52
5.2.50.0000.00411.69
5.2.40.0000.00511.72
5.2.30.0040.00011.71
5.2.20.0020.00211.42
5.2.10.0040.00011.38
5.2.00.0000.00411.40
5.1.60.0020.00211.06
5.1.50.0030.00310.72
5.1.40.0000.00511.15
5.1.30.0000.00511.11
5.1.20.0050.00010.88
5.1.10.0050.00010.96
5.1.00.0040.00010.69
5.0.50.0040.00010.45
5.0.40.0020.00210.45
5.0.30.0000.00510.45
5.0.20.0000.00410.45
5.0.10.0000.00410.45
5.0.00.0040.00010.45
4.4.90.0000.00210.45
4.4.80.0000.00210.45
4.4.70.0020.00010.45
4.4.60.0020.00010.45
4.4.50.0020.00010.45
4.4.40.0000.00310.45
4.4.30.0000.00210.45
4.4.20.0000.00210.45
4.4.10.0000.00210.45
4.4.00.0000.00210.45
4.3.110.0000.00310.45
4.3.100.0030.00010.45
4.3.90.0030.00010.45
4.3.80.0000.00310.45
4.3.70.0030.00010.45
4.3.60.0000.00210.45
4.3.50.0000.00210.45
4.3.40.0020.00010.45
4.3.30.0000.00210.45
4.3.20.0030.00010.45
4.3.10.0000.00210.45
4.3.00.0000.00210.45

preferences:
32.31 ms | 403 KiB | 5 Q