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['faster'] = &drupal_static(__FUNCTION__); } $path_auto_entity_types = &$drupal_static_fast['faster']; // 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; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vhYos
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          
   81    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 = 12
Branch analysis from position: 6
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 23
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 77) Position 1 = 32, Position 2 = 57
Branch analysis from position: 32
2 jumps found. (Code = 78) Position 1 = 33, Position 2 = 57
Branch analysis from position: 33
2 jumps found. (Code = 43) Position 1 = 39, Position 2 = 56
Branch analysis from position: 39
2 jumps found. (Code = 47) Position 1 = 43, Position 2 = 48
Branch analysis from position: 43
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 52
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
Branch analysis from position: 52
Branch analysis from position: 48
Branch analysis from position: 56
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 19
Branch analysis from position: 12
filename:       /in/vhYos
function name:  pathauto_entity_load
number of ops:  59
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, ->12
    7     6    >   INIT_FCALL_BY_NAME                                       'drupal_static'
          7        SEND_VAL_EX                                              'pathauto_entity_load'
          8        DO_FCALL                                      0  $10     
          9        MAKE_REF                                         $11     $10
         10        FETCH_DIM_W                                      $9      !2, 'faster'
         11        ASSIGN_REF                                               $9, $11
   10    12    >   FETCH_DIM_W                                      $13     !2, 'faster'
         13        ASSIGN_REF                                               !3, $13
   13    14        ISSET_ISEMPTY_CV                                 ~15     !3
         15        BOOL_NOT                                         ~16     ~15
         16      > JMPZ                                                     ~16, ->19
   14    17    >   ECHO                                                     'Database+Called%0A'
   15    18        ASSIGN                                                   !3, <array>
   19    19    >   ISSET_ISEMPTY_DIM_OBJ                         0  ~18     !3, !1
         20        BOOL_NOT                                         ~19     ~18
         21      > JMPZ                                                     ~19, ->23
   20    22    > > RETURN                                                   null
   22    23    >   INIT_FCALL_BY_NAME                                       'pathauto_entity_state_load_multiple'
         24        SEND_VAR_EX                                              !1
         25        INIT_FCALL                                               'array_keys'
         26        SEND_VAR                                                 !0
         27        DO_ICALL                                         $20     
         28        SEND_VAR_NO_REF_EX                                       $20
         29        DO_FCALL                                      0  $21     
         30        ASSIGN                                                   !4, $21
   23    31      > FE_RESET_R                                       $23     !4, ->57
         32    > > FE_FETCH_R                                       ~24     $23, !5, ->57
         33    >   ASSIGN                                                   !6, ~24
   24    34        FETCH_DIM_IS                                     ~26     !0, !6
         35        FETCH_OBJ_IS                                     ~27     ~26, 'path'
         36        ISSET_ISEMPTY_DIM_OBJ                         0  ~28     ~27, 'pathauto'
         37        BOOL_NOT                                         ~29     ~28
         38      > JMPZ                                                     ~29, ->56
   25    39    >   FETCH_DIM_IS                                     ~30     !0, !6
         40        ISSET_ISEMPTY_PROP_OBJ                           ~31     ~30, 'path'
         41        BOOL_NOT                                         ~32     ~31
         42      > JMPNZ_EX                                         ~32     ~32, ->48
         43    >   FETCH_DIM_R                                      ~33     !0, !6
         44        FETCH_OBJ_R                                      ~34     ~33, 'path'
         45        TYPE_CHECK                                  128  ~35     ~34
         46        BOOL_NOT                                         ~36     ~35
         47        BOOL                                             ~32     ~36
         48    > > JMPZ                                                     ~32, ->52
   26    49    >   FETCH_DIM_W                                      $37     !0, !6
         50        ASSIGN_OBJ                                               $37, 'path'
         51        OP_DATA                                                  <array>
   28    52    >   FETCH_DIM_W                                      $39     !0, !6
         53        FETCH_OBJ_W                                      $40     $39, 'path'
         54        ASSIGN_DIM                                               $40, 'pathauto'
         55        OP_DATA                                                  !5
   23    56    > > JMP                                                      ->32
         57    >   FE_FREE                                                  $23
   31    58      > 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/vhYos
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%0A'
   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 = 8, Position 2 = 10
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 15
Branch analysis from position: 12
Return found
Branch analysis from position: 15
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 27
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 21
Branch analysis from position: 20
Return found
Branch analysis from position: 21
Return found
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 28, Position 2 = 33
Branch analysis from position: 28
2 jumps found. (Code = 78) Position 1 = 29, Position 2 = 33
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
Branch analysis from position: 33
Return found
Branch analysis from position: 33
Branch analysis from position: 10
filename:       /in/vhYos
function name:  drupal_static
number of ops:  36
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        ECHO                                                     'drupal_static%28%29+called%0A'
   51     4        BIND_STATIC                                              !3
          5        BIND_STATIC                                              !4
   53     6        ISSET_ISEMPTY_DIM_OBJ                         0  ~6      !3, !0
          7      > JMPNZ_EX                                         ~6      ~6, ->10
          8    >   ARRAY_KEY_EXISTS                                 ~7      !0, !3
          9        BOOL                                             ~6      ~7
         10    > > JMPZ                                                     ~6, ->17
   55    11    > > JMPZ                                                     !2, ->15
   57    12    >   FETCH_DIM_R                                      ~9      !4, !0
         13        ASSIGN_DIM                                               !3, !0
         14        OP_DATA                                                  ~9
   59    15    >   FETCH_DIM_W                                      $10     !3, !0
         16      > RETURN_BY_REF                                            $10
   62    17    >   ISSET_ISEMPTY_CV                                         !0
         18      > JMPZ                                                     ~11, ->27
   63    19    > > JMPZ                                                     !2, ->21
   66    20    > > RETURN_BY_REF                                            !3
   69    21    >   ASSIGN_DIM                                       ~13     !3, !0
         22        OP_DATA                                                  !1
         23        ASSIGN_DIM                                               !4, !0
         24        OP_DATA                                                  ~13
   70    25        FETCH_DIM_W                                      $14     !3, !0
         26      > RETURN_BY_REF                                            $14
   75    27    > > FE_RESET_R                                       $15     !4, ->33
         28    > > FE_FETCH_R                                       ~16     $15, !5, ->33
         29    >   ASSIGN                                                   !0, ~16
   76    30        ASSIGN_DIM                                               !3, !0
         31        OP_DATA                                                  !5
   75    32      > JMP                                                      ->28
         33    >   FE_FREE                                                  $15
   80    34      > RETURN_BY_REF                                            !3
   81    35*     > RETURN_BY_REF                                            null

End of function drupal_static

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.89 ms | 1411 KiB | 18 Q