3v4l.org

run code in 500+ PHP versions simultaneously
<?php function no_vars() { var_dump(get_defined_vars()); } echo "\n==== function no_vars: ====\n"; no_vars(); // empty echo "\n==== function has_vars: ====\n"; function has_vars() { $var = 1; var_dump(get_defined_vars()); } has_vars(); // [var] = 1 echo "\n==== function has_args: ====\n"; function has_args($arg = 1) { var_dump(get_defined_vars()); } has_args(); // [arg] => 1 echo "\n==== anon function: ====\n"; $func = function() { var_dump(get_defined_vars()); }; $func(); // empty echo "\n==== anon function with var: ====\n"; $funcVar = function() { $var = 1; var_dump(get_defined_vars()); }; $funcVar(); // empty echo "\n==== anon function with use: ====\n"; $used = 1; $funcUses = function() use($used) { var_dump(get_defined_vars()); }; $funcUses(); // [used] = 1 echo "\n==== blank class: ====\n"; class classBlank { public function __construct() { var_dump(get_defined_vars()); } } $cBlank = new classBlank(); // empty echo "\n==== class with properties: ====\n"; class classProps { public $foo = 1; protected $bar = 2; private $meh = 3; static public $ok = 4; public function __construct() { var_dump(get_defined_vars()); } } $cProps = new classProps(); // empty? echo "\n==== static class with properties: ====\n"; class statClass { static public $stat = 1; static protected $that = 2; public static function testStat() { var_dump(get_defined_vars()); } } statClass::testStat(); echo "\n==== no context: ====\n"; var_dump(get_defined_vars()); // includes funcUses use() variables and classProps properties?

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.90.0070.00217.05
8.5.80.0040.00617.50
8.5.70.0090.01016.80
8.5.60.0130.00616.64
8.5.50.0110.00816.56
8.5.30.0090.01020.31
8.5.20.0120.00819.66
8.5.10.0120.00720.36
8.5.00.0130.01220.20
8.4.240.0120.01019.67
8.4.230.0120.01021.34
8.4.220.0090.00522.18
8.4.210.0080.01021.35
8.4.180.0090.01425.77
8.4.170.0090.01523.73
8.4.160.0140.00923.85
8.4.150.0080.00616.88
8.4.140.0190.00417.55
8.4.130.0110.00617.74
8.4.120.0130.00720.74
8.4.110.0130.00822.37
8.4.100.0100.00417.58
8.4.90.0120.00518.74
8.4.80.0030.00517.99
8.4.70.0100.00817.62
8.4.60.0060.00518.61
8.4.50.0140.00917.74
8.4.40.0100.01417.46
8.4.30.0100.01020.32
8.4.20.0120.00919.54
8.4.10.0100.00617.48
8.3.320.0150.00518.54
8.3.310.0140.00718.63
8.3.300.0140.00722.77
8.3.290.0170.00718.48
8.3.280.0120.00918.50
8.3.270.0070.01416.41
8.3.260.0130.00716.73
8.3.250.0090.01118.74
8.3.240.0070.00216.83
8.3.230.0100.01016.52
8.3.220.0110.00717.32
8.3.210.0050.00316.73
8.3.200.0050.00416.57
8.3.190.0110.00917.12
8.3.180.0140.00416.91
8.3.170.0060.00317.13
8.3.160.0110.00718.32
8.3.150.0040.01220.69
8.3.140.0090.00916.70
8.3.130.0000.01116.69
8.3.120.0060.00318.75
8.3.110.0030.00620.94
8.3.100.0050.00324.06
8.3.90.0000.00826.77
8.3.80.0090.00018.45
8.3.70.0130.00616.75
8.3.60.0090.00616.50
8.3.50.0090.00618.41
8.3.40.0070.00720.40
8.3.30.0040.01218.67
8.3.20.0000.00824.18
8.3.10.0030.00624.66
8.3.00.0050.00326.16
8.2.320.0100.01018.13
8.2.310.0110.01118.20
8.2.300.0100.01018.01
8.2.290.0120.00720.53
8.2.280.0160.00718.41
8.2.270.0120.00617.34
8.2.260.0150.00016.61
8.2.250.0060.00316.58
8.2.240.0100.00617.08
8.2.230.0070.00322.58
8.2.220.0060.01237.54
8.2.210.0030.00526.77
8.2.200.0040.00418.54
8.2.190.0110.00716.58
8.2.180.0120.00325.92
8.2.170.0070.01118.92
8.2.160.0060.01222.96
8.2.150.0000.00925.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00326.16
8.2.110.0100.00022.12
8.2.100.0120.00317.71
8.2.90.0080.00017.75
8.2.80.0040.00417.97
8.2.70.0030.00617.50
8.2.60.0030.00517.62
8.2.50.0030.00617.58
8.2.40.0080.00017.91
8.2.30.0000.00718.15
8.2.20.0080.00020.39
8.2.10.0000.00917.66
8.2.00.0040.00419.32
8.1.340.0140.00717.29
8.1.330.0120.00822.21
8.1.320.0120.00816.21
8.1.310.0030.00616.80
8.1.300.0100.01018.66
8.1.290.0060.00330.84
8.1.280.0110.00425.92
8.1.270.0000.00823.99
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0100.00723.91
8.1.230.0060.00619.11
8.1.220.0040.00417.78
8.1.210.0050.00518.77
8.1.200.0050.00517.25
8.1.190.0000.00816.99
8.1.180.0040.00418.10
8.1.170.0080.00017.65
8.1.160.0040.00418.83
8.1.150.0060.00318.59
8.1.140.0050.00317.43
8.1.130.0030.00318.95
8.1.120.0000.00817.51
8.1.110.0000.00817.48
8.1.100.0040.00417.50
8.1.90.0040.00417.38
8.1.80.0090.00017.45
8.1.70.0050.00217.50
8.1.60.0060.00317.64
8.1.50.0050.00317.56
8.1.40.0060.00317.55
8.1.30.0040.00417.62
8.1.20.0090.00017.57
8.1.10.0070.00717.50
8.1.00.0070.00817.40
8.0.300.0000.00718.77
8.0.290.0030.00616.75
8.0.280.0080.00018.48
8.0.270.0030.00316.80
8.0.260.0000.00718.48
8.0.250.0070.00016.98
8.0.240.0000.00717.05
8.0.230.0040.00416.88
8.0.220.0070.00016.84
8.0.210.0000.00716.94
8.0.200.0070.00016.99
8.0.190.0030.00517.02
8.0.180.0060.00316.98
8.0.170.0050.00316.95
8.0.160.0000.00816.93
8.0.150.0040.00416.72
8.0.140.0120.00016.71
8.0.130.0070.00416.90
8.0.120.0050.00616.81
8.0.110.0090.00716.92
8.0.100.0140.00716.89
8.0.90.0170.00516.84
8.0.80.0140.00616.93
8.0.70.0160.00416.77
8.0.60.0130.00816.90
8.0.50.0140.00716.73
8.0.30.0190.00216.73
8.0.20.0110.00916.82
8.0.10.0130.00616.93
8.0.00.0050.00716.88
7.4.330.0000.00515.55
7.4.320.0070.00016.67
7.4.300.0000.00616.52
7.4.290.0040.00416.36
7.4.280.0040.00416.62
7.4.270.0180.00416.48
7.4.260.0130.00916.54
7.4.250.0170.00616.44
7.4.240.0170.00616.45
7.4.230.0180.00716.55
7.4.220.0190.00216.54
7.4.210.0070.00516.50
7.4.200.0070.00716.46
7.4.190.0080.00616.44
7.4.180.0060.00616.52
7.4.160.0060.00516.48
7.4.150.0090.00416.39
7.4.140.0040.00716.40
7.4.130.0050.00716.41
7.4.120.0060.00516.46
7.4.110.0060.00516.42
7.4.100.0050.00716.44
7.4.90.0060.00516.41
7.4.80.0050.00416.49
7.4.70.0000.00816.38
7.4.60.0030.00716.38
7.4.50.0050.00516.30
7.4.40.0090.00216.38
7.4.30.0060.00516.44
7.4.20.0100.00016.47
7.4.10.0080.00216.44
7.4.00.0080.00216.47
7.3.330.0170.00416.22
7.3.320.0170.00316.33
7.3.310.0140.00716.28
7.3.300.0120.00916.13
7.3.290.0140.00516.19
7.3.280.0180.00416.32
7.3.270.0160.00316.36
7.3.260.0150.00416.14
7.3.250.0150.00416.06
7.3.240.0150.00316.33
7.3.230.0160.00316.29
7.3.220.0150.00516.30
7.3.210.0120.00616.11
7.3.200.0130.00616.24
7.3.190.0100.01016.06
7.3.180.0170.00816.30
7.3.170.0250.00316.29
7.3.160.0140.00516.16
7.3.150.0100.01016.32
7.3.140.0170.00316.15
7.3.130.0170.00316.30
7.3.120.0180.00016.07
7.3.110.0170.00316.20
7.3.100.0140.00516.12
7.3.90.0160.00316.53
7.3.80.0150.00516.09
7.3.70.0150.00316.44
7.3.60.0060.01216.48
7.3.50.0130.00516.56
7.3.40.0180.00016.50
7.3.30.0130.00516.42
7.3.20.0150.00418.33
7.3.10.0150.00418.11
7.3.00.0160.00318.10
7.2.340.0150.00316.21
7.2.330.0190.00016.42
7.2.320.0220.00016.35
7.2.310.0110.00816.46
7.2.300.0150.00516.23
7.2.290.0160.00316.23
7.2.280.0110.00816.38
7.2.270.0130.00716.27
7.2.260.0170.00216.29
7.2.250.0180.00016.25
7.2.240.0130.00716.28
7.2.230.0140.00516.24
7.2.220.0150.00416.43
7.2.210.0180.00016.39
7.2.200.0170.00316.55
7.2.190.0160.00316.63
7.2.180.0190.00016.56
7.2.170.0090.00916.51
7.2.160.0150.00316.41
7.2.150.0130.00518.48
7.2.140.0150.00418.55
7.2.130.0150.00518.38
7.2.120.0160.00318.49
7.2.110.0200.00318.34
7.2.100.0150.00418.38
7.2.90.0210.00318.41
7.2.80.0130.00618.46
7.2.70.0130.00518.46
7.2.60.0150.00418.52
7.2.50.0150.00318.48
7.2.40.0160.00318.41
7.2.30.0110.00818.56
7.2.20.0120.00818.52
7.2.10.0140.00618.50
7.2.00.0120.00818.28
7.1.330.0180.00515.83
7.1.320.0150.00217.41
7.1.310.0150.00317.38
7.1.300.0170.00017.41
7.1.290.0150.00317.32
7.1.280.0150.00317.27
7.1.270.0150.00317.35
7.1.260.0140.00317.15
7.1.250.0120.00617.16
7.1.240.0140.00317.32
7.1.230.0150.00317.26
7.1.220.0150.00317.30
7.1.210.0110.00717.33
7.1.200.0180.00017.31
7.1.190.0150.00317.41
7.1.180.0160.00917.13
7.1.170.0100.00917.12
7.1.160.0130.00517.25
7.1.150.0090.00917.04
7.1.140.0110.00717.23
7.1.130.0160.00317.09
7.1.120.0150.00417.13
7.1.110.0180.00017.04
7.1.100.0150.00517.10
7.1.90.0130.00617.33
7.1.80.0090.00917.12
7.1.70.0150.00417.16
7.1.60.0150.00317.33
7.1.50.0130.00517.30
7.1.40.0150.00517.39
7.1.30.0180.00017.23
7.1.20.0120.00517.16
7.1.10.0140.00517.19
7.1.00.0140.00417.30
7.0.330.0110.00616.85
7.0.320.0140.00316.89
7.0.310.0180.00016.87
7.0.300.0110.00616.77
7.0.290.0150.00416.66
7.0.280.0140.00316.91
7.0.270.0180.00016.94
7.0.260.0140.00316.88
7.0.250.0160.00617.05
7.0.240.0060.01116.89
7.0.230.0090.00916.80
7.0.220.0140.00416.78
7.0.210.0110.00716.94
7.0.200.0170.00016.91
7.0.190.0150.00516.83
7.0.180.0150.00616.90
7.0.170.0170.00417.23
7.0.160.0180.00316.94
7.0.150.0120.00916.97
7.0.140.0170.00416.81
7.0.130.0170.00316.89
7.0.120.0200.00017.00
7.0.110.0180.00316.90
7.0.100.0170.00316.97
7.0.90.0200.00216.95
7.0.80.0200.00016.97
7.0.70.0220.00016.84
7.0.60.0190.00316.72
7.0.50.0180.00616.66
7.0.40.0150.00616.93
7.0.30.0120.00817.01
7.0.20.0130.00816.73
7.0.10.0200.00016.98
7.0.00.0170.00416.94
5.6.400.0180.00015.83
5.6.390.0160.00315.66
5.6.380.0110.00815.78
5.6.370.0210.00015.77
5.6.360.0170.00315.64
5.6.350.0130.00615.84
5.6.340.0130.00715.66
5.6.330.0140.00715.65
5.6.320.0130.00715.91
5.6.310.0080.01215.66
5.6.300.0180.00215.75
5.6.290.0120.00815.65
5.6.280.0140.00615.79
5.6.270.0140.00715.83
5.6.260.0130.00715.63
5.6.250.0200.00015.92
5.6.240.0140.00415.65
5.6.230.0170.00015.88
5.6.220.0180.00015.98
5.6.210.0100.00716.00
5.6.200.0130.00415.99
5.6.190.0190.00215.84
5.6.180.0080.00815.93
5.6.170.0130.00315.91
5.6.160.0160.00016.06
5.6.150.0130.00415.97
5.6.140.0170.00015.75
5.6.130.0070.01016.00
5.6.120.0130.00315.91
5.6.110.0140.00315.91
5.6.100.0170.00015.96
5.6.90.0110.00715.64
5.6.80.0120.00415.64
5.6.70.0100.00715.89
5.6.60.0040.01516.04
5.6.50.0080.00815.62
5.6.40.0160.00015.84
5.6.30.0070.01015.87
5.6.20.0160.00015.60
5.6.10.0120.00415.75
5.6.00.0140.00315.81
5.5.380.0140.00315.75
5.5.370.0170.00015.82
5.5.360.0100.00715.74
5.5.350.0130.00415.79
5.5.340.0120.00615.63
5.5.330.0160.00315.72
5.5.320.0170.00015.57
5.5.310.0080.00815.55
5.5.300.0140.00315.79
5.5.290.0080.00815.66
5.5.280.0160.00015.54
5.5.270.0130.00415.56
5.5.260.0170.00015.53
5.5.250.0080.00816.00
5.5.240.0130.00315.80
5.5.230.0080.00815.52
5.5.220.0160.00015.78
5.5.210.0110.00515.96
5.5.200.0080.00815.67
5.5.190.0130.00315.57
5.5.180.0110.00515.45
5.5.170.0080.00815.69
5.5.160.0080.00815.68
5.5.150.0130.00315.36
5.5.140.0130.00315.51
5.5.130.0140.00315.45
5.5.120.0100.00515.44
5.5.110.0160.00015.35
5.5.100.0120.00615.72
5.5.90.0180.00015.84
5.5.80.0170.00315.68
5.5.70.0100.01015.67
5.5.60.0170.00315.97
5.5.50.0170.00015.80
5.5.40.0150.00415.80
5.5.30.0160.00315.82
5.5.20.0100.01015.84
5.5.10.0180.00015.61
5.5.00.0210.00015.61
5.4.450.0140.00113.57
5.4.440.0140.00312.83
5.4.430.0120.00312.64
5.4.420.0180.00012.68
5.4.410.0110.00512.46
5.4.400.0110.00412.59
5.4.390.0120.00412.77
5.4.380.0110.00412.77
5.4.370.0050.01112.38
5.4.360.0060.00912.69
5.4.350.0090.00612.76
5.4.340.0120.00412.62
5.4.330.0090.00912.76
5.4.320.0080.00812.82
5.4.310.0120.00412.75
5.4.300.0100.00712.66
5.4.290.0150.00012.63
5.4.280.0140.00512.73
5.4.270.0110.00412.73
5.4.260.0120.00312.45
5.4.250.0130.00312.57
5.4.240.0140.00012.76
5.4.230.0070.00712.57
5.4.220.0150.00012.43
5.4.210.0110.00412.42
5.4.200.0130.00312.21
5.4.190.0160.00012.50
5.4.180.0120.00312.43
5.4.170.0070.00712.57
5.4.160.0140.00012.25
5.4.150.0080.00512.35
5.4.140.0070.00712.63
5.4.130.0130.00012.57
5.4.120.0090.00512.59
5.4.110.0140.00012.61
5.4.100.0110.00312.58
5.4.90.0100.00312.58
5.4.80.0030.01012.58
5.4.70.0110.00312.57
5.4.60.0140.00012.73
5.4.50.0130.00012.43
5.4.40.0100.00312.74
5.4.30.0070.00712.58
5.4.20.0140.00012.71
5.4.10.0130.00012.73
5.4.00.0060.00612.32
5.3.290.0090.00513.00
5.3.280.0070.00713.16
5.3.270.0140.00012.95
5.3.260.0110.00512.98
5.3.250.0140.00313.22
5.3.240.0150.00012.79
5.3.230.0140.00012.99
5.3.220.0140.00012.97
5.3.210.0090.00412.77
5.3.200.0140.00012.92
5.3.190.0120.00213.04
5.3.180.0100.00413.24
5.3.170.0110.00712.89
5.3.160.0070.00713.07
5.3.150.0170.00012.95
5.3.140.0110.00413.08
5.3.130.0140.00013.06
5.3.120.0140.00012.85
5.3.110.0110.00312.88
5.3.100.0100.00312.86
5.3.90.0130.00012.94
5.3.80.0080.00512.96
5.3.70.0100.00212.96
5.3.60.0100.00312.88
5.3.50.0090.00513.01
5.3.40.0070.00712.79
5.3.30.0110.00312.88
5.3.20.0100.00312.88
5.3.10.0140.00012.93
5.3.00.0140.00012.85
5.2.170.0060.00611.89
5.2.160.0110.00011.70
5.2.150.0040.00711.60
5.2.140.0070.00311.57
5.2.130.0050.00511.85
5.2.120.0110.00011.64
5.2.110.0080.00311.80
5.2.100.0080.00311.61
5.2.90.0070.00311.82
5.2.80.0120.00011.54
5.2.70.0130.00011.53
5.2.60.0060.00611.54
5.2.50.0100.00311.83
5.2.40.0060.00611.79
5.2.30.0070.00311.76
5.2.20.0070.00411.57
5.2.10.0080.00311.34
5.2.00.0100.00011.50
5.1.60.0050.00510.93
5.1.50.0090.00010.92
5.1.40.0060.00310.94
5.1.30.0090.00010.88
5.1.20.0070.00210.68
5.1.10.0100.00010.93
5.1.00.0100.00010.44
5.0.50.0070.00010.39
5.0.40.0080.00010.39
5.0.30.0000.00810.39
5.0.20.0040.00410.39
5.0.10.0050.00310.39
5.0.00.0050.00210.39
4.4.90.0000.00510.39
4.4.80.0030.00210.39
4.4.70.0030.00210.39
4.4.60.0050.00010.39
4.4.50.0050.00010.39
4.4.40.0040.00010.39
4.4.30.0050.00010.39
4.4.20.0050.00010.39
4.4.10.0000.00510.39
4.4.00.0040.00010.39
4.3.110.0040.00010.39
4.3.100.0050.00010.39
4.3.90.0050.00010.39
4.3.80.0050.00010.39
4.3.70.0040.00010.39
4.3.60.0050.00010.39
4.3.50.0050.00010.39
4.3.40.0050.00010.39
4.3.30.0030.00010.39
4.3.20.0020.00210.39
4.3.10.0020.00210.39
4.3.00.0020.00210.39

preferences:
160.1 ms | 3873 KiB | 5 Q