3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $data; public function __construct() { $this->data = array( 'first' => 0 ); } public function __set($property, $value) { if(isset($this->$property)) { $this->$property = $value; } else { $this->data[$property] = $value; } } public function __get($property) { if(isset($this->$property)) { return $this->$property; } else { return (int)$this->data[$property]; } } } $test = new Test(); $test->first++; echo $test->first;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boHFg
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        PRE_INC_OBJ                                              !0, 'first'
   30     4        FETCH_OBJ_R                                      ~5      !0, 'first'
          5        ECHO                                                     ~5
          6      > RETURN                                                   1

Class Test:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boHFg
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN_OBJ                                               'data'
    6     1        OP_DATA                                                  <array>
    8     2      > RETURN                                                   null

End of function __construct

Function __set:
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 = 10
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boHFg
function name:  __set
number of ops:  11
compiled vars:  !0 = $property, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2        ISSET_ISEMPTY_PROP_OBJ                                   !0
          3      > JMPZ                                                     ~2, ->7
   12     4    >   ASSIGN_OBJ                                               !0
          5        OP_DATA                                                  !1
          6      > JMP                                                      ->10
   14     7    >   FETCH_OBJ_W                                      $4      'data'
          8        ASSIGN_DIM                                               $4, !0
          9        OP_DATA                                                  !1
   16    10    > > RETURN                                                   null

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/boHFg
function name:  __get
number of ops:  11
compiled vars:  !0 = $property
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   19     1        ISSET_ISEMPTY_PROP_OBJ                                   !0
          2      > JMPZ                                                     ~1, ->6
   20     3    >   FETCH_OBJ_R                                      ~2      !0
          4      > RETURN                                                   ~2
          5*       JMP                                                      ->10
   22     6    >   FETCH_OBJ_R                                      ~3      'data'
          7        FETCH_DIM_R                                      ~4      ~3, !0
          8        CAST                                          4  ~5      ~4
          9      > RETURN                                                   ~5
   24    10*     > RETURN                                                   null

End of function __get

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.35 ms | 1403 KiB | 13 Q