3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public const TOTO = 'cocou'; protected $foo = []; public function set($a) { $this->foo[$a::TOTO] = 'Totot'; } } $a = 'A'; $o= new A(); $o->set($a); var_dump($o);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XD7hf
function name:  (null)
number of ops:  11
compiled vars:  !0 = $a, !1 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ASSIGN                                                   !0, 'A'
   17     1        NEW                                              $3      'A'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   18     4        INIT_METHOD_CALL                                         !1, 'set'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   20     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class A:
Function set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XD7hf
function name:  set
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        FETCH_CLASS                                   0  $2      !0
          2        FETCH_CLASS_CONSTANT                             ~3      $2, 'TOTO'
          3        FETCH_OBJ_W                                      $1      'foo'
          4        ASSIGN_DIM                                               $1, ~3
          5        OP_DATA                                                  'Totot'
   12     6      > RETURN                                                   null

End of function set

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.25 ms | 1386 KiB | 15 Q