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'; $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'; return array( 15518 => 1, 15519 => 1, 15542 => 1, 15551 => 0, ); } // Copied from D7. function &drupal_static($name, $default_value = NULL, $reset = FALSE) { 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.0090.00718.66
8.4.120.0120.00723.83
8.4.110.0110.01017.80
8.4.100.0150.00518.62
8.4.90.0150.00622.05
8.4.80.0050.00420.39
8.4.70.0050.00417.81
8.4.60.0140.00518.61
8.4.50.0140.00718.88
8.4.40.0130.00617.89
8.4.30.0100.01017.81
8.4.20.0000.01517.55
8.4.10.0060.00317.61
8.3.260.0130.00616.47
8.3.250.0120.00718.66
8.3.240.0120.00917.33
8.3.230.0110.00916.63
8.3.220.0100.00619.05
8.3.210.0120.00916.85
8.3.200.0050.00416.74
8.3.190.0060.00319.22
8.3.180.0090.00717.32
8.3.170.0040.01518.83
8.3.160.0150.00416.46
8.3.150.0030.01317.13
8.3.140.0080.00016.79
8.3.130.0060.00318.66
8.3.120.0070.00020.63
8.3.110.0080.00016.74
8.3.100.0060.00316.54
8.3.90.0030.00526.77
8.3.80.0060.00317.97
8.3.70.0170.00016.50
8.3.60.0120.00316.63
8.3.50.0080.01121.22
8.3.40.0100.00718.55
8.3.30.0070.00719.04
8.3.20.0070.00020.29
8.3.10.0080.00021.77
8.3.00.0050.00317.63
8.2.290.0120.00620.62
8.2.280.0040.00618.74
8.2.270.0150.00317.20
8.2.260.0040.00418.53
8.2.250.0000.00816.87
8.2.240.0000.00818.39
8.2.230.0080.00020.94
8.2.220.0000.00824.06
8.2.210.0110.00726.77
8.2.200.0100.00018.88
8.2.190.0140.00316.61
8.2.180.0160.00316.50
8.2.170.0100.00322.96
8.2.160.0120.00320.32
8.2.150.0060.00324.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0080.00020.94
8.2.110.0030.00621.11
8.2.100.0060.00617.66
8.2.90.0050.00317.84
8.2.80.0030.00519.02
8.2.70.0000.00818.03
8.2.60.0040.00418.05
8.2.50.0000.00818.10
8.2.40.0000.00720.61
8.2.30.0000.00718.23
8.2.20.0080.00017.64
8.2.10.0070.00018.13
8.2.00.0070.00018.04
8.1.330.0110.00721.92
8.1.320.0130.00716.31
8.1.310.0120.00418.04
8.1.300.0060.00317.94
8.1.290.0110.00030.84
8.1.280.0280.00025.92
8.1.270.0030.00520.39
8.1.260.0020.00526.35
8.1.250.0080.00828.09
8.1.240.0110.00021.06
8.1.230.0060.00622.14
8.1.220.0000.00817.74
8.1.210.0060.00318.77
8.1.200.0040.00417.35
8.1.190.0080.00017.53
8.1.180.0000.00818.10
8.1.170.0060.00318.38
8.1.160.0040.00422.12
8.1.150.0040.00418.89
8.1.140.0000.00717.38
8.1.130.0000.00717.82
8.1.120.0030.00317.45
8.1.110.0000.00717.39
8.1.100.0040.00317.44
8.1.90.0070.00017.40
8.1.80.0070.00017.51
8.1.70.0000.00717.47
8.1.60.0040.00417.53
8.1.50.0060.00317.54
8.1.40.0080.00017.56
8.1.30.0000.00817.62
8.1.20.0040.00417.66
8.1.10.0000.00717.53
8.1.00.0030.00617.38
8.0.300.0050.00220.14
8.0.290.0040.00416.75
8.0.280.0000.00718.52
8.0.270.0070.00016.84
8.0.260.0000.00617.27
8.0.250.0000.00716.88
8.0.240.0040.00416.88
8.0.230.0030.00516.86
8.0.220.0040.00416.87
8.0.210.0030.00316.89
8.0.200.0070.00016.94
8.0.190.0000.00916.92
8.0.180.0000.00716.89
8.0.170.0000.00716.83
8.0.160.0040.00316.91
8.0.150.0000.00816.78
8.0.140.0070.00016.84
8.0.130.0060.00013.36
8.0.120.0050.00316.76
8.0.110.0040.00416.93
8.0.100.0040.00416.93
8.0.90.0000.00716.73
8.0.80.0040.01116.93
8.0.70.0040.00416.74
8.0.60.0050.00216.78
8.0.50.0040.00416.85
8.0.30.0120.01017.11
8.0.20.0190.00517.40
8.0.10.0000.00716.91
8.0.00.0080.01016.69
7.4.330.0020.00215.14
7.4.320.0070.00016.59
7.4.300.0000.00616.61
7.4.290.0030.00316.52
7.4.280.0060.00316.62
7.4.270.0000.00716.65
7.4.260.0050.00316.59
7.4.250.0040.00416.46
7.4.240.0020.00616.51
7.4.230.0080.00016.49
7.4.220.0120.00916.47
7.4.210.0080.01016.54
7.4.200.0000.00716.66
7.4.160.0070.01016.47
7.4.150.0120.00617.40
7.4.140.0070.01417.86
7.4.130.0110.01116.50
7.4.120.0100.00716.47
7.4.110.0130.00416.72
7.4.100.0140.00916.60
7.4.90.0070.01016.47
7.4.80.0070.01019.39
7.4.70.0090.00916.61
7.4.60.0060.01016.53
7.4.50.0000.00616.16
7.4.40.0120.00916.51
7.4.30.0070.01016.56
7.4.00.0030.01015.03
7.3.330.0060.00013.26
7.3.320.0060.00613.23
7.3.310.0030.00316.50
7.3.300.0030.00316.31
7.3.290.0000.00716.45
7.3.280.0110.00716.40
7.3.270.0110.00517.40
7.3.260.0040.01616.27
7.3.250.0110.00716.43
7.3.240.0080.00816.52
7.3.230.0000.01816.39
7.3.210.0080.00816.38
7.3.200.0140.00819.39
7.3.190.0060.01016.50
7.3.180.0030.01416.34
7.3.170.0080.00816.73
7.3.160.0130.00316.46
7.2.330.0150.00416.62
7.2.320.0150.00316.38
7.2.310.0090.01216.67
7.2.300.0080.01216.78
7.2.290.0030.01916.52
7.2.80.0060.01016.52
7.2.60.0000.00916.63
7.1.200.0030.00615.57
7.1.70.0030.00717.21
7.1.60.0070.00717.28
7.1.50.0060.01617.05
7.1.00.0070.07322.54
7.0.200.0040.01116.68
7.0.60.0130.08019.91
7.0.50.0100.06717.92
7.0.40.0170.08720.11
7.0.30.0400.06720.34
7.0.20.0300.06320.23
7.0.10.0070.08720.08
7.0.00.0030.04320.22
5.6.280.0000.07721.08
5.6.210.0100.07720.73
5.6.200.0130.07718.20
5.6.190.0170.04320.66
5.6.180.3170.04320.47
5.6.170.0200.04320.55
5.6.160.0100.05720.62
5.6.150.0170.02718.16
5.6.140.0100.04718.15
5.6.130.0070.03718.14
5.6.120.0030.05320.92
5.6.110.0000.05321.06
5.6.100.0070.06721.02
5.6.90.0170.07721.10
5.6.80.0000.04020.40
5.5.350.0230.03020.42
5.5.340.0070.04717.95
5.5.330.0070.04020.42
5.5.320.0330.05720.34
5.5.310.0270.04020.30
5.5.300.0070.08017.92
5.5.290.0030.04018.06
5.5.280.0030.05020.75
5.5.270.0030.07720.90
5.5.260.0000.09020.74
5.5.250.0200.05720.57
5.5.240.0130.06020.14
5.4.450.0100.03719.17
5.4.440.0230.04719.27
5.4.430.0430.04019.41
5.4.420.0170.06019.38
5.4.410.0170.05319.11
5.4.400.0170.04718.89
5.4.390.0170.04718.65
5.4.380.0100.05718.60
5.4.370.0030.06018.82
5.4.360.0200.06018.48
5.4.350.0300.06018.76
5.4.340.0170.07318.60
5.4.320.0130.06318.54
5.4.310.0070.06718.62
5.4.300.0100.05318.59
5.4.290.0130.04718.76
5.4.280.0170.04318.61
5.4.270.0230.05018.70
5.4.260.0070.07318.71
5.4.250.0200.05018.84
5.4.240.0100.07018.48
5.4.230.0200.04318.58
5.4.220.0130.06718.79
5.4.210.0230.04318.65
5.4.200.0070.06316.58
5.4.190.0170.06018.77
5.4.180.0100.05318.61
5.4.170.0270.04718.79
5.4.160.0070.05718.49
5.4.150.0170.04718.59
5.4.140.0070.06016.28
5.4.130.0200.04016.27
5.4.120.0270.04716.27
5.4.110.0100.05016.22
5.4.100.0030.06016.30
5.4.90.0100.05316.22
5.4.80.0070.05316.29
5.4.70.0070.06316.42
5.4.60.0070.05316.42
5.4.50.0100.05316.27
5.4.40.0130.06716.17
5.4.30.0170.05316.17
5.4.20.0200.06716.17
5.4.10.0170.04716.30
5.4.00.0200.04715.76
5.3.290.0130.05714.71
5.3.280.0130.05314.60
5.3.270.0130.07014.78
5.3.260.0130.05314.76
5.3.250.0200.06314.77
5.3.240.0100.05714.68
5.3.230.0030.06314.66
5.3.220.0200.04714.72
5.3.210.0170.05014.79
5.3.200.0100.06014.77
5.3.190.0130.05714.71
5.3.180.0100.05314.62
5.3.170.0130.05314.71
5.3.160.0170.04714.75
5.3.150.0200.04714.77
5.3.140.0270.05314.60
5.3.130.0270.06014.75
5.3.120.0170.05714.77
5.3.110.0070.06014.77
5.3.100.0200.05014.16
5.3.90.0130.05714.17
5.3.80.0170.05314.02
5.3.70.0100.06714.07
5.3.60.0100.06014.13
5.3.50.0100.05314.01
5.3.40.0100.05314.10
5.3.30.0100.06314.16
5.3.20.0200.04313.76
5.3.10.0130.05013.75
5.3.00.0070.06013.70
5.2.170.0030.06011.21
5.2.160.0200.04011.17
5.2.150.0100.04711.38
5.2.140.0100.04711.29
5.2.130.0100.04311.19
5.2.120.0130.03311.35
5.2.110.0130.03711.16
5.2.100.0170.03711.18
5.2.90.0030.05011.35
5.2.80.0130.05311.14
5.2.70.0030.04711.15
5.2.60.0100.04011.20
5.2.50.0130.05311.04
5.2.40.0070.04311.13
5.2.30.0170.05011.09
5.2.20.0170.04710.96
5.2.10.0030.04311.06
5.2.00.0130.03710.81
5.1.60.0000.04310.10
5.1.50.0100.03710.00
5.1.40.0070.04010.00
5.1.30.0070.04310.53
5.1.20.0030.04310.36
5.1.10.0070.03710.18
5.1.00.0030.04010.11
5.0.50.0000.0338.61
5.0.40.0070.0238.49
5.0.30.0030.0508.30
5.0.20.0070.0378.26
5.0.10.0070.0378.19
5.0.00.0000.0578.40
4.4.90.0030.0235.93
4.4.80.0070.0235.96
4.4.70.0000.0305.90
4.4.60.0030.0235.93
4.4.50.0130.0175.93
4.4.40.0000.0406.03
4.4.30.0000.0276.01
4.4.20.0000.0375.99
4.4.10.0000.0305.96
4.4.00.0030.0436.04
4.3.110.0070.0275.91
4.3.100.0000.0335.86
4.3.90.0070.0175.94
4.3.80.0000.0375.82
4.3.70.0030.0235.83
4.3.60.0000.0235.92
4.3.50.0030.0305.97
4.3.40.0030.0475.79
4.3.30.0070.0204.62
4.3.20.0030.0234.60
4.3.10.0070.0274.59
4.3.00.0070.01315.67

preferences:
38.51 ms | 403 KiB | 5 Q