3v4l.org

run code in 300+ PHP versions simultaneously
<?php function pathauto_entity_load($entities, $type) { static $drupal_static_fast; if (!isset($drupal_static_fast)) { $drupal_static_fast = &drupal_static(__FUNCTION__); } $path_auto_entity_types = &$drupal_static_fast; // Save the entity types used statically to avoid unnessasary queries later. if (!isset($path_auto_entity_types)) { print "Database Called\n"; $path_auto_entity_types = array('node', 'taxonomy_term'); } // We aren't storing state for this type at the moment. if (!isset($path_auto_entity_types[$type])) { return; } $states = pathauto_entity_state_load_multiple($type, array_keys($entities)); foreach ($states as $id => $state) { if (!isset($entities[$id]->path['pathauto'])) { if (!isset($entities[$id]->path) || !is_array($entities[$id]->path)) { $entities[$id]->path = array(); } $entities[$id]->path['pathauto'] = $state; } } } pathauto_entity_load(array( 15518,15519,15542,15551,), 'node'); pathauto_entity_load(array( 15518,15519,15542,15551,), 'taxonomy_term'); pathauto_entity_load(array( 15518,15519,15542,15551,), 'fake'); function pathauto_entity_state_load_multiple($type, $entites) { print "states loaded\n"; return array( 15518 => 1, 15519 => 1, 15542 => 1, 15551 => 0, ); } // Copied from D7. function &drupal_static($name, $default_value = NULL, $reset = FALSE) { print "drupal_static() called\n"; static $data = array(), $default = array(); // First check if dealing with a previously defined static variable. if (isset($data [$name]) || array_key_exists($name, $data)) { // Non-NULL $name and both $data[$name] and $default[$name] statics exist. if ($reset) { // Reset pre-existing static variable to its default value. $data [$name] = $default [$name]; } return $data [$name]; } // Neither $data[$name] nor $default[$name] static variables exist. if (isset($name)) { if ($reset) { // Reset was called before a default is set and yet a variable must be // returned. return $data; } // First call with new non-NULL $name. Initialize a new static variable. $default [$name] = $data [$name] = $default_value; return $data [$name]; } // Reset all: ($name == NULL). This needs to be done one at a time so that // references returned by earlier invocations of drupal_static() also get // reset. foreach ($default as $name => $value) { $data [$name] = $value; } // As the function returns a reference, the return should always be a // variable. return $data; }

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.130.0130.00717.64
8.4.120.0040.00523.96
8.4.110.0140.00722.27
8.4.100.0090.01119.10
8.4.90.0130.00718.98
8.4.80.0150.00618.92
8.4.70.0050.00318.12
8.4.60.0130.00718.93
8.4.50.0070.00219.48
8.4.40.0130.00717.79
8.4.30.0100.01017.68
8.4.20.0130.00717.56
8.4.10.0060.00317.61
8.3.260.0140.00516.75
8.3.250.0120.00718.97
8.3.240.0140.00517.24
8.3.230.0140.00517.11
8.3.220.0110.00819.14
8.3.210.0090.00716.82
8.3.200.0050.00416.71
8.3.190.0120.00718.67
8.3.180.0120.00716.67
8.3.170.0040.01418.93
8.3.160.0150.00316.52
8.3.150.0030.01517.13
8.3.140.0090.00018.42
8.3.130.0070.00318.60
8.3.120.0080.00818.80
8.3.110.0060.00920.94
8.3.100.0060.00324.06
8.3.90.0150.00426.77
8.3.80.0070.00319.36
8.3.70.0120.00318.68
8.3.60.0120.00618.31
8.3.50.0120.00721.20
8.3.40.0150.00318.59
8.3.30.0110.00319.04
8.3.20.0040.00420.38
8.3.10.0080.00023.48
8.3.00.0040.01117.50
8.2.290.0100.00820.65
8.2.280.0140.00518.38
8.2.270.0030.01517.13
8.2.260.0030.01419.04
8.2.250.0040.00716.53
8.2.240.0040.00417.42
8.2.230.0040.00422.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0040.00418.88
8.2.190.0170.00316.75
8.2.180.0060.01216.63
8.2.170.0060.00922.96
8.2.160.0070.00720.38
8.2.150.0180.00024.18
8.2.140.0030.00624.66
8.2.130.0030.00526.16
8.2.120.0060.00619.19
8.2.110.0000.01020.94
8.2.100.0000.01417.84
8.2.90.0030.00617.38
8.2.80.0030.00518.70
8.2.70.0040.00417.38
8.2.60.0040.00417.50
8.2.50.0000.00917.55
8.2.40.0030.00517.63
8.2.30.0040.00418.22
8.2.20.0040.00417.63
8.2.10.0000.00818.10
8.2.00.0070.00018.00
8.1.330.0100.00821.88
8.1.320.0110.00818.66
8.1.310.0090.00916.65
8.1.300.0040.00418.51
8.1.290.0100.00030.84
8.1.280.0100.01025.92
8.1.270.0060.00320.29
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0050.00322.19
8.1.230.0060.00622.27
8.1.220.0000.00818.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0000.00917.35
8.1.180.0060.00618.10
8.1.170.0000.00817.62
8.1.160.0050.00221.91
8.1.150.0040.00418.81
8.1.140.0000.00817.34
8.1.130.0030.00317.83
8.1.120.0000.00717.41
8.1.110.0000.00817.49
8.1.100.0040.00417.49
8.1.90.0050.00217.50
8.1.80.0000.00717.38
8.1.70.0040.00417.49
8.1.60.0040.00417.64
8.1.50.0000.00817.45
8.1.40.0040.00417.54
8.1.30.0000.00817.61
8.1.20.0000.00817.63
8.1.10.0000.00717.43
8.1.00.0040.00417.41
8.0.300.0040.00420.03
8.0.290.0090.00016.75
8.0.280.0000.00718.37
8.0.270.0050.00217.31
8.0.260.0000.00717.21
8.0.250.0070.00016.98
8.0.240.0040.00416.83
8.0.230.0030.00516.99
8.0.220.0030.00316.86
8.0.210.0000.00716.97
8.0.200.0030.00316.87
8.0.190.0030.00916.96
8.0.180.0080.00016.91
8.0.170.0030.00516.80
8.0.160.0000.00816.89
8.0.150.0000.00716.75
8.0.140.0040.00416.93
8.0.130.0000.00613.32
8.0.120.0050.00316.89
8.0.110.0050.00216.94
8.0.100.0070.00016.86
8.0.90.0040.00416.84
8.0.80.0060.01116.93
8.0.70.0000.00716.80
8.0.60.0050.00216.86
8.0.50.0050.00216.71
8.0.30.0160.00717.10
8.0.20.0100.01017.40
8.0.10.0040.00416.90
8.0.00.0090.00816.82
7.4.330.0050.00015.07
7.4.320.0040.00416.54
7.4.300.0000.00716.63
7.4.290.0000.00716.54
7.4.280.0050.00316.60
7.4.270.0000.00816.53
7.4.260.0030.00616.62
7.4.250.0020.00516.48
7.4.240.0050.00316.52
7.4.230.0030.00316.72
7.4.220.0110.01116.63
7.4.210.0100.00716.58
7.4.200.0070.00016.52
7.4.160.0130.00316.48
7.4.150.0100.01417.40
7.4.140.0080.01017.86
7.4.130.0080.01016.47
7.4.120.0090.00816.65
7.4.110.0160.00816.52
7.4.100.0120.00616.49
7.4.90.0110.00716.53
7.4.80.0140.00819.39
7.4.70.0030.01316.32
7.4.60.0110.00516.41
7.4.50.0030.00516.34
7.4.40.0040.01816.58
7.4.30.0070.01016.56
7.4.00.0070.00714.89
7.3.330.0000.00713.22
7.3.320.0040.00813.36
7.3.310.0070.00016.46
7.3.300.0040.00416.41
7.3.290.0030.00516.45
7.3.280.0080.01116.36
7.3.270.0160.00417.40
7.3.260.0110.00616.68
7.3.250.0040.01516.41
7.3.240.0070.01016.40
7.3.230.0030.01916.53
7.3.210.0070.01116.37
7.3.200.0170.00019.39
7.3.190.0030.01316.30
7.3.180.0120.00616.14
7.3.170.0110.00716.37
7.3.160.0060.01316.45
7.2.330.0030.01416.61
7.2.320.0060.01016.66
7.2.310.0170.00016.82
7.2.300.0130.00616.54
7.2.290.0140.00316.78
7.2.60.0030.01016.95
7.2.00.0080.00819.66
7.1.200.0070.00715.86
7.1.100.0030.01018.06
7.1.70.0000.01017.20
7.1.60.0120.00919.50
7.1.50.0100.01616.85
7.1.00.0070.07322.35
7.0.200.0030.00316.88
7.0.60.0130.08019.96
7.0.50.0000.05017.83
7.0.40.0130.08020.11
7.0.30.0130.04720.21
7.0.20.0230.04320.06
7.0.10.0000.06020.19
7.0.00.0030.05320.29
5.6.280.0030.07320.91
5.6.210.0030.06720.64
5.6.200.0030.04018.24
5.6.190.0200.07320.34
5.6.180.0300.07320.50
5.6.170.0230.07320.56
5.6.160.0070.04320.55
5.6.150.0000.09018.18
5.6.140.0000.09318.28
5.6.130.0030.04318.15
5.6.120.0170.06321.11
5.6.110.0030.04321.15
5.6.100.0170.07721.04
5.6.90.0070.05021.03
5.6.80.0030.04320.30
5.5.350.0030.04320.43
5.5.340.0030.09018.09
5.5.330.0030.07320.38
5.5.320.0070.04720.31
5.5.310.0200.07020.32
5.5.300.0070.06317.94
5.5.290.0000.07318.08
5.5.280.0100.07020.82
5.5.270.0030.06020.87
5.5.260.0070.08320.77
5.5.250.0100.08720.68
5.5.240.0100.04720.04
5.4.450.0270.05019.41
5.4.440.0600.04319.55
5.4.430.0230.04019.54
5.4.420.0100.05719.68
5.4.410.0100.05319.02
5.4.400.0100.05718.86
5.4.390.0170.04718.74
5.4.380.0100.07318.58
5.4.370.0030.06018.76
5.4.360.0130.05018.61
5.4.350.0030.06018.76
5.4.340.0100.05318.71
5.4.320.0170.05018.78
5.4.310.0100.05018.61
5.4.300.0100.05718.74
5.4.290.0300.03318.74
5.4.280.0100.05018.83
5.4.270.0100.05718.83
5.4.260.0100.05318.71
5.4.250.0270.06018.59
5.4.240.0200.04718.61
5.4.230.0100.05318.54
5.4.220.0130.05318.75
5.4.210.0100.05018.75
5.4.200.0170.04716.64
5.4.190.0000.06318.51
5.4.180.0030.06018.69
5.4.170.0170.04718.60
5.4.160.0070.05318.73
5.4.150.0030.05718.72
5.4.140.0230.05016.25
5.4.130.0030.05316.24
5.4.120.0170.05716.34
5.4.110.0300.05016.37
5.4.100.0070.05316.39
5.4.90.0100.05016.29
5.4.80.0070.05316.25
5.4.70.0130.04716.33
5.4.60.0030.06016.20
5.4.50.0130.05016.19
5.4.40.0100.05016.25
5.4.30.0230.03716.41
5.4.20.0170.04716.26
5.4.10.0100.04716.31
5.4.00.0000.05715.90
5.3.290.0100.06014.73
5.3.280.0130.04714.78
5.3.270.0030.06014.85
5.3.260.0070.05714.67
5.3.250.0070.05314.68
5.3.240.0130.05014.63
5.3.230.0130.04714.84
5.3.220.0070.05314.63
5.3.210.0170.04714.71
5.3.200.0000.06014.57
5.3.190.0100.06014.59
5.3.180.0130.05314.61
5.3.170.0130.05314.57
5.3.160.0100.05714.63
5.3.150.0030.05714.79
5.3.140.0100.05014.57
5.3.130.0130.05014.59
5.3.120.0100.05314.59
5.3.110.0200.04714.62
5.3.100.0200.05314.20
5.3.90.0070.05314.14
5.3.80.0130.05014.25
5.3.70.0130.04714.16
5.3.60.0130.04714.16
5.3.50.0170.04714.18
5.3.40.0130.06314.02
5.3.30.0170.06013.91
5.3.20.0170.06013.84
5.3.10.0130.06313.72
5.3.00.0100.05013.79
5.2.170.0030.04311.15
5.2.160.0070.04011.29
5.2.150.0130.03711.30
5.2.140.0130.04011.19
5.2.130.0100.04011.23
5.2.120.0130.05011.13
5.2.110.0030.04711.35
5.2.100.0030.04311.18
5.2.90.0170.03311.16
5.2.80.0100.04011.34
5.2.70.0070.04311.15
5.2.60.0100.04011.12
5.2.50.0070.04311.08
5.2.40.0070.04011.15
5.2.30.0200.03011.04
5.2.20.0130.05011.03
5.2.10.0000.04310.92
5.2.00.0070.04010.79
5.1.60.0070.03310.02
5.1.50.0070.03710.10
5.1.40.0070.03710.19
5.1.30.0000.04310.34
5.1.20.0100.03310.48
5.1.10.0070.03710.09
5.1.00.0070.04010.19
5.0.50.0000.0338.77
5.0.40.0100.0238.50
5.0.30.0070.0438.34
5.0.20.0070.0278.27
5.0.10.0030.0308.25
5.0.00.0030.0538.33
4.4.90.0100.0175.94
4.4.80.0030.0235.91
4.4.70.0030.0235.89
4.4.60.0030.0235.96
4.4.50.0030.0235.95
4.4.40.0070.0376.05
4.4.30.0030.0206.01
4.4.20.0030.0236.00
4.4.10.0070.0206.04
4.4.00.0000.0435.98
4.3.110.0000.0235.89
4.3.100.0000.0235.89
4.3.90.0000.0235.88
4.3.80.0030.0335.90
4.3.70.0000.0235.82
4.3.60.0100.0135.87
4.3.50.0030.0205.91
4.3.40.0030.0335.79
4.3.30.0000.0234.63
4.3.20.0000.0234.56
4.3.10.0000.0234.55
4.3.00.0030.01315.76

preferences:
140.09 ms | 403 KiB | 5 Q