3v4l.org

run code in 300+ PHP versions simultaneously
<?php function objectType($name, ...$fields) { if (empty($fields)) { throw new \RuntimeException(); } if (!is_string(key($fields[0]))) { $interfaces = array_shift($fields); } else { $interfaces = []; } if (empty($fields)) { throw new \RuntimeException(); } $def = [ 'name' => $name, 'interfaces' => $interfaces, 'fields' => [], ]; foreach ($fields as &$field) { $def['fields'][$field['name']] = $field; } return $def; } function field($name, $type, ...$args) { $def = [ 'name' => $name, 'type' => $type, 'args' => [], 'resolve' => null, ]; if (!empty($args) && is_callable(end($args))) { $def['resolve'] = array_pop($args); } foreach ($args as &$arg) { $def['args'][$arg['name']] = $arg; } return $def; } function argument($name, $type, $value = null) { $def = [ 'name' => $name, 'type' => $type, 'defaultValue' => $value, ]; return $def; } $IntType = ['name' => 'Int']; $StringType = ['name' => 'String']; $BlogType = objectType('Blog', field('id', $IntType), field('name', $StringType)); $UserType = objectType('Blog', field('id', $IntType, function () {}), field('email', $StringType)); $QueryType = objectType('Query', field('blog', $BlogType, argument('id', $IntType)), field('user', $UserType, argument('id', $IntType))); var_dump($QueryType);

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.3.60.0090.01316.61
8.3.50.0220.00018.30
8.3.40.0040.01118.84
8.3.30.0100.00718.63
8.3.20.0070.01320.16
8.3.10.0140.00423.70
8.3.00.0050.00319.50
8.2.180.0100.01316.35
8.2.170.0000.01622.96
8.2.160.0000.01820.58
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.00517.63
8.2.120.0000.00826.35
8.2.110.0060.00320.43
8.2.100.0090.00318.22
8.2.90.0080.00019.22
8.2.80.0040.00417.97
8.2.70.0080.00017.49
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0080.00019.36
8.2.30.0000.00720.75
8.2.20.0000.00817.94
8.2.10.0030.00618.37
8.2.00.0080.00018.20
8.1.280.0120.00625.92
8.1.270.0090.00023.71
8.1.260.0000.00828.09
8.1.250.0090.00028.09
8.1.240.0030.00723.70
8.1.230.0000.01118.97
8.1.220.0030.00517.74
8.1.210.0000.00918.77
8.1.200.0030.00717.48
8.1.190.0040.00417.25
8.1.180.0050.00318.10
8.1.170.0000.00818.57
8.1.160.0000.00721.98
8.1.150.0000.00818.89
8.1.140.0070.00319.61
8.1.130.0000.00717.80
8.1.120.0040.00417.51
8.1.110.0030.00517.56
8.1.100.0030.00617.52
8.1.90.0040.00417.50
8.1.80.0000.00917.48
8.1.70.0000.00717.41
8.1.60.0040.00417.66
8.1.50.0030.00517.59
8.1.40.0040.00417.53
8.1.30.0030.00617.74
8.1.20.0000.00817.52
8.1.10.0050.00317.53
8.1.00.0040.00417.41
8.0.300.0050.00318.77
8.0.290.0000.00716.88
8.0.280.0030.00318.42
8.0.270.0000.00717.30
8.0.260.0000.00717.31
8.0.250.0070.00016.90
8.0.240.0040.00417.02
8.0.230.0080.00016.96
8.0.220.0030.00516.85
8.0.210.0000.00916.94
8.0.200.0000.00716.89
8.0.190.0000.00717.01
8.0.180.0040.00416.95
8.0.170.0050.00316.85
8.0.160.0050.00516.91
8.0.150.0080.00016.81
8.0.140.0050.00316.79
8.0.130.0060.00013.33
8.0.120.0030.00516.80
8.0.110.0000.00816.86
8.0.100.0040.00416.89
8.0.90.0000.00716.84
8.0.80.0060.01216.91
8.0.70.0000.00716.90
8.0.60.0080.00016.77
8.0.50.0030.00516.98
8.0.30.0050.01517.23
8.0.20.0110.01217.40
8.0.10.0080.00016.89
8.0.00.0130.00716.94
7.4.330.0020.00216.76
7.4.320.0000.00616.66
7.4.300.0030.00316.57
7.4.290.0050.00316.56
7.4.280.0000.00716.46
7.4.270.0000.00716.66
7.4.260.0040.00416.41
7.4.250.0040.00416.45
7.4.240.0040.00316.52
7.4.230.0000.00716.55
7.4.220.0130.00716.59
7.4.210.0060.00916.60
7.4.200.0000.00716.68
7.4.160.0100.01016.60
7.4.150.0080.01217.40
7.4.140.0110.01117.86
7.4.130.0140.00516.50
7.4.120.0130.00716.56
7.4.110.0120.00816.41
7.4.100.0060.01916.54
7.4.90.0100.01016.52
7.4.80.0100.00919.39
7.4.70.0160.00816.39
7.4.60.0070.01016.63
7.4.50.0000.01316.43
7.4.40.0080.01116.63
7.4.30.0060.01216.67
7.4.10.0140.00314.99
7.4.00.0080.00914.80
7.3.330.0040.00313.25
7.3.320.0000.00613.40
7.3.310.0040.00416.24
7.3.300.0030.00416.31
7.3.290.0090.00716.40
7.3.280.0080.01116.39
7.3.270.0110.01117.40
7.3.260.0170.00316.45
7.3.250.0140.00816.46
7.3.240.0060.01416.50
7.3.230.0170.00816.49
7.3.210.0110.00716.34
7.3.200.0130.00416.30
7.3.190.0040.01416.50
7.3.180.0060.01316.73
7.3.170.0120.00816.70
7.3.160.0080.01016.38
7.3.130.0070.00714.89
7.3.120.0160.00314.77
7.3.110.0070.01114.96
7.3.100.0100.00314.83
7.3.90.0070.00714.95
7.3.80.0000.01414.77
7.3.70.0000.01114.66
7.3.60.0040.01114.64
7.3.50.0000.01015.01
7.3.40.0100.00714.69
7.3.30.0000.00914.92
7.3.20.0100.00716.59
7.3.10.0000.01516.80
7.3.00.0030.01316.79
7.2.330.0040.01516.76
7.2.320.0170.01816.76
7.2.310.0090.00916.76
7.2.300.0090.00916.44
7.2.290.0080.01116.48
7.2.260.0070.00714.90
7.2.250.0090.00914.70
7.2.240.0040.01115.19
7.2.230.0070.00714.98
7.2.220.0090.00614.88
7.2.210.0100.00614.84
7.2.200.0000.01015.07
7.2.190.0030.01715.05
7.2.180.0000.01415.15
7.2.170.0130.00015.10
7.2.160.0090.00614.97
7.2.150.0060.00916.90
7.2.140.0110.00417.06
7.2.130.0100.00317.06
7.2.120.0070.00716.97
7.2.110.0070.01016.99
7.2.100.0000.01416.67
7.2.90.0040.01116.96
7.2.80.0030.01316.96
7.2.70.0120.00617.02
7.2.60.0050.01016.85
7.2.50.0070.00716.74
7.2.40.0090.00616.66
7.2.30.0060.01217.03
7.2.20.0070.00317.02
7.2.10.0060.00616.99
7.2.00.0050.01318.31
7.1.330.0070.00715.56
7.1.320.0030.01315.86
7.1.310.0030.01015.69
7.1.300.0070.00715.59
7.1.290.0030.01315.98
7.1.280.0080.00415.57
7.1.270.0080.00815.71
7.1.260.0080.00815.84
7.1.250.0060.00915.77
7.1.240.0060.01215.82
7.1.230.0080.00915.82
7.1.220.0070.01115.83
7.1.210.0060.00915.86
7.1.200.0060.00815.88
7.1.190.0030.00615.88
7.1.180.0060.00615.93
7.1.170.0060.00615.54
7.1.160.0030.00615.96
7.1.150.0100.00315.84
7.1.140.0120.00015.91
7.1.130.0060.00615.77
7.1.120.0030.01215.84
7.1.110.0100.00715.60
7.1.100.0050.01016.91
7.1.90.0030.00615.70
7.1.80.0000.01715.80
7.1.70.0060.00616.44
7.1.60.0050.01617.47
7.1.50.0020.01416.42
7.1.40.0030.01015.82
7.1.30.0030.01015.56
7.1.20.0000.01415.68
7.1.10.0040.01115.40
7.1.00.0050.04219.12
7.0.330.0070.00315.25
7.0.320.0130.00015.42
7.0.310.0070.01015.34
7.0.300.0060.00615.55
7.0.290.0090.00615.49
7.0.280.0060.00615.14
7.0.270.0090.00315.48
7.0.260.0080.00515.41
7.0.250.0060.01015.09
7.0.240.0060.01015.30
7.0.230.0040.01115.47
7.0.220.0120.00315.43
7.0.210.0130.00615.52
7.0.200.0010.01215.98
7.0.190.0100.00315.50
7.0.180.0090.00615.50
7.0.170.0030.01015.35
7.0.160.0060.00315.49
7.0.150.0100.00315.40
7.0.140.0070.00415.41
7.0.130.0070.00715.27
7.0.120.0030.01015.61
7.0.110.0000.01415.43
7.0.100.0070.00715.39
7.0.90.0040.00715.53
7.0.80.0070.01015.43
7.0.70.0100.00615.46
7.0.60.0150.03517.74
7.0.50.0030.02816.69
7.0.40.0040.03116.75
7.0.30.0170.04116.72
7.0.20.0160.02316.90
7.0.10.0150.04216.82
7.0.00.0020.03316.89
5.6.400.0030.01314.12
5.6.390.0030.01214.15
5.6.380.0120.00414.24
5.6.370.0040.00714.02
5.6.360.0030.00914.22
5.6.350.0110.00314.25
5.6.340.0000.01014.27
5.6.330.0040.00814.14
5.6.320.0040.01014.77
5.6.310.0060.00914.63
5.6.300.0030.00714.45
5.6.290.0060.00614.63
5.6.280.0050.02017.70
5.6.270.0040.00414.45
5.6.260.0000.01314.28
5.6.250.0050.00514.45
5.6.240.0070.00714.73
5.6.230.0070.01014.24
5.6.220.0070.01314.47
5.6.210.0030.03317.61
5.6.200.0000.03616.23
5.6.190.0110.03517.49
5.6.180.0130.02317.56
5.6.170.0180.03417.33
5.6.160.0080.04417.51
5.6.150.0090.01816.24
5.6.140.0100.03816.37
5.6.130.0060.02316.29
5.6.120.0120.03317.74
5.6.110.0100.04117.75
5.6.100.0080.04717.59
5.6.90.0030.02517.63
5.6.80.0100.03817.29
5.6.70.0070.00414.25
5.6.60.0030.00914.64
5.6.50.0000.01014.18
5.6.40.0030.01314.36
5.6.30.0000.01414.15
5.6.20.0000.01514.34
5.6.10.0030.01314.50
5.6.00.0060.01014.52
5.5.380.0040.00714.02
5.5.370.0070.01113.90
5.5.360.0000.01513.95
5.5.350.0170.03817.05
5.5.340.0120.03815.97
5.5.330.0070.03717.33
5.5.320.0070.02017.25
5.5.310.0150.04517.14
5.5.300.0100.03816.17
5.5.290.0070.02415.94
5.5.280.0080.04317.36
5.5.270.0080.02017.46
5.5.260.0130.03817.31
5.5.250.0040.04117.14
5.5.240.0170.04016.92
5.5.230.0030.01013.84
5.5.220.0030.01014.04
5.5.210.0030.00614.02
5.5.200.0040.00814.08
5.5.190.0060.00614.21
5.5.180.0000.01214.01
5.5.170.0030.01214.06
5.5.160.0060.00614.06
5.5.150.0040.00814.20
5.5.140.0070.00314.00
5.5.130.0000.01113.94
5.5.120.0030.01014.03
5.5.110.0070.00713.49
5.5.100.0050.00513.92
5.5.90.0040.00714.06
5.5.80.0000.00914.10
5.5.70.0030.00613.72
5.5.60.0110.00313.75
5.5.50.0100.00313.99
5.5.40.0030.01213.91
5.5.30.0040.00413.70
5.5.20.0030.00814.22
5.5.10.0000.01113.73
5.5.00.0060.00914.24

preferences:
45.36 ms | 400 KiB | 5 Q