3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Cache{ protected function put($key,$value){ static $cache = []; var_dump($cache); return $cache[$key] = $value; } } $instance1 = new class extends Cache{ public function store($key,$value) { return $this->put($key,$value); } }; $instance1->store("one",1); $instance1->store("two",2); $instance1->store("three",3); $instance2 = new class extends Cache{ public function store($key,$value) { return $this->put($key,$value); } }; $instance2->store("four",4); $instance2->store("five",5); $instance3 = new class extends Cache{ public function store($key,$value) { return $this->put($key,$value); } }; $instance3->store("six",6); $instance3->store("seven",7);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qLpoT
function name:  (null)
number of ops:  41
compiled vars:  !0 = $instance1, !1 = $instance2, !2 = $instance3
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   DECLARE_ANON_CLASS                               <unknown> 'cache'
          1        NEW                                              $4      $3
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
   19     4        INIT_METHOD_CALL                                         !0, 'store'
          5        SEND_VAL_EX                                              'one'
          6        SEND_VAL_EX                                              1
          7        DO_FCALL                                      0          
   20     8        INIT_METHOD_CALL                                         !0, 'store'
          9        SEND_VAL_EX                                              'two'
         10        SEND_VAL_EX                                              2
         11        DO_FCALL                                      0          
   21    12        INIT_METHOD_CALL                                         !0, 'store'
         13        SEND_VAL_EX                                              'three'
         14        SEND_VAL_EX                                              3
         15        DO_FCALL                                      0          
   24    16        DECLARE_ANON_CLASS                               <unknown> 'cache'
         17        NEW                                              $11     $10
         18        DO_FCALL                                      0          
         19        ASSIGN                                                   !1, $11
   32    20        INIT_METHOD_CALL                                         !1, 'store'
         21        SEND_VAL_EX                                              'four'
         22        SEND_VAL_EX                                              4
         23        DO_FCALL                                      0          
   33    24        INIT_METHOD_CALL                                         !1, 'store'
         25        SEND_VAL_EX                                              'five'
         26        SEND_VAL_EX                                              5
         27        DO_FCALL                                      0          
   36    28        DECLARE_ANON_CLASS                               <unknown> 'cache'
         29        NEW                                              $17     $16
         30        DO_FCALL                                      0          
         31        ASSIGN                                                   !2, $17
   44    32        INIT_METHOD_CALL                                         !2, 'store'
         33        SEND_VAL_EX                                              'six'
         34        SEND_VAL_EX                                              6
         35        DO_FCALL                                      0          
   45    36        INIT_METHOD_CALL                                         !2, 'store'
         37        SEND_VAL_EX                                              'seven'
         38        SEND_VAL_EX                                              7
         39        DO_FCALL                                      0          
         40      > RETURN                                                   1

Class Cache:
Function put:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qLpoT
function name:  put
number of ops:  10
compiled vars:  !0 = $key, !1 = $value, !2 = $cache
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        BIND_STATIC                                              !2
    6     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !2
          5        DO_ICALL                                                 
    7     6        ASSIGN_DIM                                       ~4      !2, !0
          7        OP_DATA                                                  !1
          8      > RETURN                                                   ~4
    8     9*     > RETURN                                                   null

End of function put

End of class Cache.

Class Cache@anonymous:
Function store:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qLpoT
function name:  store
number of ops:  8
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   15     2        INIT_METHOD_CALL                                         'put'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   16     7*     > RETURN                                                   null

End of function store

End of class Cache@anonymous.

Class Cache@anonymous:
Function store:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qLpoT
function name:  store
number of ops:  8
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   28     2        INIT_METHOD_CALL                                         'put'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   29     7*     > RETURN                                                   null

End of function store

End of class Cache@anonymous.

Class Cache@anonymous:
Function store:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qLpoT
function name:  store
number of ops:  8
compiled vars:  !0 = $key, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   38     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   40     2        INIT_METHOD_CALL                                         'put'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   41     7*     > RETURN                                                   null

End of function store

End of class Cache@anonymous.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
133.28 ms | 1409 KiB | 15 Q