3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Singleton { # Holds Parent Instance private static $_instance; # Holds Current zval private $_arg; # No Direct Need For This Other Than Stopping Call To new Class private function __construct() {} # Singleton Design public static function getInstance() { return self::$_instance ?? (self::$_instance = new self()); } # Store a reference of the variable to share the zval # Needed to re-pass the variable by reference to share the zval to _arg public function bindArg(&$arg) { $this->_arg =& $arg; } # Output the value of the stored reference if exists public function helloWorld() { echo $this->_arg ?? 'Did not exist.'; } } final class Test { use \Singleton { helloWorld as public peekabo; } } Test::getInstance()->bindArg($row); foreach(['Hello', ',', ' World'] as $row) Test::getInstance()->peekabo();

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.0050.00524.23
8.4.110.0110.00922.52
8.4.100.0120.00817.80
8.4.90.0140.00520.77
8.4.80.0050.00417.93
8.4.70.0090.00619.80
8.4.60.0120.00720.34
8.4.50.0070.00222.33
8.4.40.0090.00919.28
8.4.30.0080.00022.50
8.4.20.0170.00320.48
8.4.10.0030.00617.52
8.3.250.0070.01118.95
8.3.240.0110.00817.01
8.3.230.0100.00916.73
8.3.220.0090.01017.21
8.3.210.0060.00418.26
8.3.200.0060.00316.80
8.3.190.0130.00616.27
8.3.180.0040.00516.58
8.3.170.0090.00618.79
8.3.160.0100.01020.02
8.3.150.0060.01316.64
8.3.140.0080.00017.16
8.3.130.0110.00418.33
8.3.120.0090.00019.21
8.3.110.0000.01520.94
8.3.100.0070.01124.06
8.3.90.0110.00426.77
8.3.80.0090.00017.97
8.3.70.0040.01118.40
8.3.60.0130.00918.56
8.3.50.0120.00617.24
8.3.40.0110.00718.79
8.3.30.0120.00318.76
8.3.20.0000.00721.95
8.3.10.0050.00323.51
8.3.00.0040.00420.71
8.2.290.0090.01020.72
8.2.280.0060.00318.50
8.2.270.0150.00318.88
8.2.260.0040.00418.39
8.2.250.0050.00316.97
8.2.240.0030.00718.98
8.2.230.0090.00022.58
8.2.220.0000.00837.54
8.2.210.0130.00626.77
8.2.200.0060.00318.54
8.2.190.0100.00716.58
8.2.180.0130.00616.75
8.2.170.0100.01022.96
8.2.160.0110.00320.14
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00419.76
8.2.120.0070.00026.35
8.2.110.0030.00622.07
8.2.100.0070.00417.78
8.2.90.0000.00918.03
8.2.80.0080.00018.98
8.2.70.0000.00917.63
8.2.60.0050.00317.49
8.2.50.0050.00318.10
8.2.40.0000.00719.23
8.2.30.0050.00219.14
8.2.20.0000.00717.97
8.2.10.0060.00319.27
8.2.00.0070.00019.50
8.1.330.0120.00721.87
8.1.320.0100.00916.24
8.1.310.0000.00818.71
8.1.300.0060.00316.21
8.1.290.0060.00330.84
8.1.280.0070.01125.92
8.1.270.0080.00019.06
8.1.260.0070.00426.35
8.1.250.0090.00028.09
8.1.240.0040.00422.61
8.1.230.0070.00320.97
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0040.00417.35
8.1.190.0090.00017.35
8.1.180.0000.00818.10
8.1.170.0000.00818.65
8.1.160.0060.00318.85
8.1.150.0020.00518.82
8.1.140.0040.00420.78
8.1.130.0000.00720.26
8.1.120.0000.00717.52
8.1.110.0000.00717.38
8.1.100.0000.01117.52
8.1.90.0050.00317.44
8.1.80.0000.00717.39
8.1.70.0040.00417.38
8.1.60.0030.00617.45
8.1.50.0080.00017.46
8.1.40.0080.00017.56
8.1.30.0040.00417.69
8.1.20.0000.00917.55
8.1.10.0040.00417.52
8.1.00.0000.00717.49
8.0.300.0040.00420.20
8.0.290.0090.00016.73
8.0.280.0040.00418.52
8.0.270.0030.00317.29
8.0.260.0040.00418.55
8.0.250.0030.00317.00
8.0.240.0050.00217.02
8.0.230.0000.00716.95
8.0.220.0030.00316.89
8.0.210.0030.00516.80
8.0.200.0030.00317.01
8.0.190.0000.00717.01
8.0.180.0030.00516.82
8.0.170.0060.00316.89
8.0.160.0000.00816.93
8.0.150.0070.00016.82
8.0.140.0000.00716.79
8.0.130.0060.00013.41
8.0.120.0040.00416.89
8.0.110.0040.00416.86
8.0.100.0040.00416.83
8.0.90.0050.00316.73
8.0.80.0130.00616.87
8.0.70.0000.00716.71
8.0.60.0050.00216.83
8.0.50.0000.00716.80
8.0.30.0130.00717.12
8.0.20.0110.00717.40
8.0.10.0070.00016.86
8.0.00.0130.00516.70
7.4.330.0050.00215.55
7.4.320.0000.00616.53
7.4.300.0030.00316.45
7.4.290.0000.00616.61
7.4.280.0050.00316.61
7.4.270.0030.00316.57
7.4.260.0030.00316.58
7.4.250.0040.00416.61
7.4.240.0030.00516.52
7.4.230.0070.00016.51
7.4.220.0070.00016.51
7.4.210.0080.01016.54
7.4.200.0000.00716.46
7.4.160.0100.00616.47
7.4.140.0130.00817.86
7.4.130.0140.01416.52
7.4.120.0090.00916.49
7.4.110.0060.01316.54
7.4.100.0140.00316.46
7.4.90.0120.00616.49
7.4.80.0080.00819.39
7.4.70.0060.01016.50
7.4.60.0090.00916.53
7.4.50.0030.01016.48
7.4.40.0060.01116.76
7.4.10.0070.01015.23
7.4.00.0080.00714.90
7.3.330.0040.00413.13
7.3.320.0000.00513.18
7.3.310.0030.00516.35
7.3.300.0030.00316.32
7.3.290.0000.00716.28
7.3.280.0070.01116.31
7.3.260.0110.00716.41
7.3.240.0080.01016.38
7.3.230.0120.00616.24
7.3.210.0100.00716.33
7.3.200.0000.01516.40
7.3.190.0120.00916.26
7.3.180.0030.01616.31
7.3.170.0100.01316.18
7.3.160.0100.01116.61
7.3.130.0000.01814.54
7.3.120.0070.01014.62
7.3.110.0080.01214.70
7.3.100.0080.00014.89
7.3.90.0030.00714.64
7.3.80.0030.01014.79
7.3.70.0070.01014.50
7.3.60.0060.00914.48
7.3.50.0040.01114.94
7.3.40.0070.00714.78
7.3.30.0030.00914.80
7.3.20.0030.00616.34
7.3.10.0170.00715.49
7.3.00.0180.00715.59
7.2.330.0040.01516.66
7.2.320.0080.01716.77
7.2.310.0130.00316.64
7.2.300.0060.01016.58
7.2.290.0130.00316.75
7.2.260.0040.01415.18
7.2.250.0030.01515.04
7.2.240.0000.01514.94
7.2.230.0100.00315.07
7.2.220.0130.00315.27
7.2.210.0100.00614.96
7.2.200.0070.01015.21
7.2.190.0090.00615.09
7.2.180.0000.01415.21
7.2.170.0040.01514.98
7.2.160.0030.00715.13
7.2.150.0100.00016.77
7.2.140.0030.01016.86
7.2.130.0180.00915.93
7.2.120.0180.01216.06
7.2.110.0230.01115.94
7.2.100.0140.01115.99
7.2.90.0190.00615.89
7.2.80.0150.01015.85
7.2.70.0410.00915.87
7.2.60.0190.01115.84
7.2.50.0200.01115.98
7.2.40.0270.00616.01
7.2.30.0240.01115.94
7.2.20.0180.00515.90
7.2.10.0190.00916.07
7.2.00.0180.00815.86
7.1.330.0070.00715.73
7.1.320.0030.01015.72
7.1.310.0000.01415.86
7.1.300.0060.00615.78
7.1.290.0040.01115.63
7.1.280.0030.00915.78
7.1.270.0120.00315.83
7.1.260.0030.00915.82
7.1.250.0170.00914.48
7.1.240.0040.01115.61
7.1.230.0040.01115.82
7.1.220.0060.00915.77
7.1.210.0060.00615.89
7.1.200.0060.00615.62
7.1.190.0030.01015.65
7.1.180.0000.01115.62
7.1.170.0030.00915.65
7.1.160.0040.00415.66
7.1.150.0080.00015.54
7.1.140.0030.00515.90
7.1.130.0000.01315.84
7.1.120.0060.00315.58
7.1.110.0000.01315.63
7.1.100.0040.00715.59
7.1.90.0080.00315.64
7.1.80.0080.00415.71
7.1.70.0060.00615.78
7.1.60.0040.00415.72
7.1.50.0070.00715.90
7.1.40.0000.00815.73
7.1.30.0070.00315.78
7.1.20.0080.00415.72
7.1.10.0060.00315.57
7.1.00.0040.00915.86

preferences:
28.47 ms | 403 KiB | 5 Q