3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Msg { var $x = array(); function a() { echo "CONSTRUCTOR CALLED\r\n"; } function testStaticSet() { Msg::setValue("ERROR", 'HELLO!'); } function setValue($name, $value) { $this->x[$name] = $value; } function getValue($name) { return $this->x[$name]; } } //Msg::setValue("ERROR", 'Hello World!'); //echo Msg::getValue("ERROR"); $a = new Msg(); $a->testStaticSet(); echo $a->getValue("ERROR");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EMmdm
function name:  (null)
number of ops:  10
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   NEW                                              $1      'Msg'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   25     3        INIT_METHOD_CALL                                         !0, 'testStaticSet'
          4        DO_FCALL                                      0          
   26     5        INIT_METHOD_CALL                                         !0, 'getValue'
          6        SEND_VAL_EX                                              'ERROR'
          7        DO_FCALL                                      0  $5      
          8        ECHO                                                     $5
          9      > RETURN                                                   1

Class Msg:
Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EMmdm
function name:  a
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'CONSTRUCTOR+CALLED%0D%0A'
    7     1      > RETURN                                                   null

End of function a

Function teststaticset:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EMmdm
function name:  testStaticSet
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   INIT_STATIC_METHOD_CALL                                  'Msg', 'setValue'
          1        SEND_VAL_EX                                              'ERROR'
          2        SEND_VAL_EX                                              'HELLO%21'
          3        DO_FCALL                                      0          
   11     4      > RETURN                                                   null

End of function teststaticset

Function setvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EMmdm
function name:  setValue
number of ops:  6
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   14     2        FETCH_OBJ_W                                      $2      'x'
          3        ASSIGN_DIM                                               $2, !0
          4        OP_DATA                                                  !1
   15     5      > RETURN                                                   null

End of function setvalue

Function getvalue:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EMmdm
function name:  getValue
number of ops:  5
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   RECV                                             !0      
   18     1        FETCH_OBJ_R                                      ~1      'x'
          2        FETCH_DIM_R                                      ~2      ~1, !0
          3      > RETURN                                                   ~2
   19     4*     > RETURN                                                   null

End of function getvalue

End of class Msg.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.06 ms | 1399 KiB | 13 Q