3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public static function b ($id) { static $mandateCache = array(); if (array_key_exists($id, $mandateCache)) { $mandate = $mandateCache[$id]; } else { print 'Fetching id ' . $id . "\n"; $mandateCache[$id] = $id; } } } A::b(1); A::b(1); A::b(2); A::b(1); A::b(2); A::b(1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uXRjg
function name:  (null)
number of ops:  19
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_STATIC_METHOD_CALL                                  'A', 'b'
          1        SEND_VAL                                                 1
          2        DO_FCALL                                      0          
   16     3        INIT_STATIC_METHOD_CALL                                  'A', 'b'
          4        SEND_VAL                                                 1
          5        DO_FCALL                                      0          
   17     6        INIT_STATIC_METHOD_CALL                                  'A', 'b'
          7        SEND_VAL                                                 2
          8        DO_FCALL                                      0          
   18     9        INIT_STATIC_METHOD_CALL                                  'A', 'b'
         10        SEND_VAL                                                 1
         11        DO_FCALL                                      0          
   19    12        INIT_STATIC_METHOD_CALL                                  'A', 'b'
         13        SEND_VAL                                                 2
         14        DO_FCALL                                      0          
   20    15        INIT_STATIC_METHOD_CALL                                  'A', 'b'
         16        SEND_VAL                                                 1
         17        DO_FCALL                                      0          
         18      > RETURN                                                   1

Class A:
Function b:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 7
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uXRjg
function name:  b
number of ops:  13
compiled vars:  !0 = $id, !1 = $mandateCache, !2 = $mandate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        BIND_STATIC                                              !1
    6     2        ARRAY_KEY_EXISTS                                         !0, !1
          3      > JMPZ                                                     ~3, ->7
    7     4    >   FETCH_DIM_R                                      ~4      !1, !0
          5        ASSIGN                                                   !2, ~4
          6      > JMP                                                      ->12
    9     7    >   CONCAT                                           ~6      'Fetching+id+', !0
          8        CONCAT                                           ~7      ~6, '%0A'
          9        ECHO                                                     ~7
   10    10        ASSIGN_DIM                                               !1, !0
         11        OP_DATA                                                  !0
   12    12    > > RETURN                                                   null

End of function b

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.47 ms | 1395 KiB | 13 Q