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; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1LUUR
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   INIT_FCALL                                               'pathauto_entity_load'
          1        SEND_VAL                                                 <array>
          2        SEND_VAL                                                 'node'
          3        DO_FCALL                                      0          
   35     4        INIT_FCALL                                               'pathauto_entity_load'
          5        SEND_VAL                                                 <array>
          6        SEND_VAL                                                 'taxonomy_term'
          7        DO_FCALL                                      0          
   36     8        INIT_FCALL                                               'pathauto_entity_load'
          9        SEND_VAL                                                 <array>
         10        SEND_VAL                                                 'fake'
         11        DO_FCALL                                      0          
   80    12      > RETURN                                                   1

Function pathauto_entity_load:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 10
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 16
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 20
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 54
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 54
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 36, Position 2 = 53
Branch analysis from position: 36
2 jumps found. (Code = 47) Position 1 = 40, Position 2 = 45
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 46, Position 2 = 49
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 49
Branch analysis from position: 45
Branch analysis from position: 53
Branch analysis from position: 54
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 54
Branch analysis from position: 16
Branch analysis from position: 10
filename:       /in/1LUUR
function name:  pathauto_entity_load
number of ops:  56
compiled vars:  !0 = $entities, !1 = $type, !2 = $drupal_static_fast, !3 = $path_auto_entity_types, !4 = $states, !5 = $state, !6 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        BIND_STATIC                                              !2
    6     3        ISSET_ISEMPTY_CV                                 ~7      !2
          4        BOOL_NOT                                         ~8      ~7
          5      > JMPZ                                                     ~8, ->10
    7     6    >   INIT_FCALL_BY_NAME                                       'drupal_static'
          7        SEND_VAL_EX                                              'pathauto_entity_load'
          8        DO_FCALL                                      0  $9      
          9        ASSIGN_REF                                               !2, $9
   10    10    >   ASSIGN_REF                                               !3, !2
   13    11        ISSET_ISEMPTY_CV                                 ~12     !3
         12        BOOL_NOT                                         ~13     ~12
         13      > JMPZ                                                     ~13, ->16
   14    14    >   ECHO                                                     'Database+Called'
   15    15        ASSIGN                                                   !3, <array>
   19    16    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~15     !3, !1
         17        BOOL_NOT                                         ~16     ~15
         18      > JMPZ                                                     ~16, ->20
   20    19    > > RETURN                                                   null
   22    20    >   INIT_FCALL_BY_NAME                                       'pathauto_entity_state_load_multiple'
         21        SEND_VAR_EX                                              !1
         22        INIT_FCALL                                               'array_keys'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $17     
         25        SEND_VAR_NO_REF_EX                                       $17
         26        DO_FCALL                                      0  $18     
         27        ASSIGN                                                   !4, $18
   23    28      > FE_RESET_R                                       $20     !4, ->54
         29    > > FE_FETCH_R                                       ~21     $20, !5, ->54
         30    >   ASSIGN                                                   !6, ~21
   24    31        FETCH_DIM_IS                                     ~23     !0, !6
         32        FETCH_OBJ_IS                                     ~24     ~23, 'path'
         33        ISSET_ISEMPTY_DIM_OBJ                         0  ~25     ~24, 'pathauto'
         34        BOOL_NOT                                         ~26     ~25
         35      > JMPZ                                                     ~26, ->53
   25    36    >   FETCH_DIM_IS                                     ~27     !0, !6
         37        ISSET_ISEMPTY_PROP_OBJ                           ~28     ~27, 'path'
         38        BOOL_NOT                                         ~29     ~28
         39      > JMPNZ_EX                                         ~29     ~29, ->45
         40    >   FETCH_DIM_R                                      ~30     !0, !6
         41        FETCH_OBJ_R                                      ~31     ~30, 'path'
         42        TYPE_CHECK                                  128  ~32     ~31
         43        BOOL_NOT                                         ~33     ~32
         44        BOOL                                             ~29     ~33
         45    > > JMPZ                                                     ~29, ->49
   26    46    >   FETCH_DIM_W                                      $34     !0, !6
         47        ASSIGN_OBJ                                               $34, 'path'
         48        OP_DATA                                                  <array>
   28    49    >   FETCH_DIM_W                                      $36     !0, !6
         50        FETCH_OBJ_W                                      $37     $36, 'path'
         51        ASSIGN_DIM                                               $37, 'pathauto'
         52        OP_DATA                                                  !5
   23    53    > > JMP                                                      ->29
         54    >   FE_FREE                                                  $20
   31    55      > RETURN                                                   null

End of function pathauto_entity_load

Function pathauto_entity_state_load_multiple:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1LUUR
function name:  pathauto_entity_state_load_multiple
number of ops:  5
compiled vars:  !0 = $type, !1 = $entites
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   39     2        ECHO                                                     'states+loaded'
   41     3      > RETURN                                                   <array>
   46     4*     > RETURN                                                   null

End of function pathauto_entity_state_load_multiple

Function drupal_static:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 7, Position 2 = 9
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
Return found
Branch analysis from position: 14
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 26
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 20
Branch analysis from position: 19
Return found
Branch analysis from position: 20
Return found
Branch analysis from position: 26
2 jumps found. (Code = 77) Position 1 = 27, Position 2 = 32
Branch analysis from position: 27
2 jumps found. (Code = 78) Position 1 = 28, Position 2 = 32
Branch analysis from position: 28
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
Branch analysis from position: 32
Return found
Branch analysis from position: 32
Branch analysis from position: 9
filename:       /in/1LUUR
function name:  drupal_static
number of ops:  35
compiled vars:  !0 = $name, !1 = $default_value, !2 = $reset, !3 = $data, !4 = $default, !5 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      <false>
   50     3        BIND_STATIC                                              !3
          4        BIND_STATIC                                              !4
   52     5        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !3, !0
          6      > JMPNZ_EX                                         ~6      ~6, ->9
          7    >   ARRAY_KEY_EXISTS                                 ~7      !0, !3
          8        BOOL                                             ~6      ~7
          9    > > JMPZ                                                     ~6, ->16
   54    10    > > JMPZ                                                     !2, ->14
   56    11    >   FETCH_DIM_R                                      ~9      !4, !0
         12        ASSIGN_DIM                                               !3, !0
         13        OP_DATA                                                  ~9
   58    14    >   FETCH_DIM_W                                      $10     !3, !0
         15      > RETURN_BY_REF                                            $10
   61    16    >   ISSET_ISEMPTY_CV                                         !0
         17      > JMPZ                                                     ~11, ->26
   62    18    > > JMPZ                                                     !2, ->20
   65    19    > > RETURN_BY_REF                                            !3
   68    20    >   ASSIGN_DIM                                       ~13     !3, !0
         21        OP_DATA                                                  !1
         22        ASSIGN_DIM                                               !4, !0
         23        OP_DATA                                                  ~13
   69    24        FETCH_DIM_W                                      $14     !3, !0
         25      > RETURN_BY_REF                                            $14
   74    26    > > FE_RESET_R                                       $15     !4, ->32
         27    > > FE_FETCH_R                                       ~16     $15, !5, ->32
         28    >   ASSIGN                                                   !0, ~16
   75    29        ASSIGN_DIM                                               !3, !0
         30        OP_DATA                                                  !5
   74    31      > JMP                                                      ->27
         32    >   FE_FREE                                                  $15
   79    33      > RETURN_BY_REF                                            !3
   80    34*     > RETURN_BY_REF                                            null

End of function drupal_static

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.02 ms | 1087 KiB | 17 Q