3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Smth { public function __get($name) { echo "Get: " . $name . "\n"; return $name == "abc" ? null : 1; } public function __set($name, $value) { echo "Set: " . $name . " to " . $value . "\n"; } } $x = new Smth(); $x->abc ??= 7; $x->cde ??= 8;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e62A6
function name:  (null)
number of ops:  16
compiled vars:  !0 = $x
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   NEW                                                  $1      'Smth'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   15     3        FETCH_OBJ_IS                                         ~4      !0, 'abc'
          4        COALESCE                                             ~5      ~4
          5        ASSIGN_OBJ                                           ~6      !0, 'abc'
          6        OP_DATA                                                      7
          7        QM_ASSIGN                                            ~5      ~6
          8        FREE                                                         ~5
   16     9        FETCH_OBJ_IS                                         ~7      !0, 'cde'
         10        COALESCE                                             ~8      ~7
         11        ASSIGN_OBJ                                           ~9      !0, 'cde'
         12        OP_DATA                                                      8
         13        QM_ASSIGN                                            ~8      ~9
         14        FREE                                                         ~8
   17    15      > RETURN                                                       1

Class Smth:
Function __get:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 8
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e62A6
function name:  __get
number of ops:  11
compiled vars:  !0 = $name
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        CONCAT                                               ~1      'Get%3A+', !0
          2        CONCAT                                               ~2      ~1, '%0A'
          3        ECHO                                                         ~2
    6     4        IS_EQUAL                                                     !0, 'abc'
          5      > JMPZ                                                         ~3, ->8
          6    >   QM_ASSIGN                                            ~4      null
          7      > JMP                                                          ->9
          8    >   QM_ASSIGN                                            ~4      1
          9    > > RETURN                                                       ~4
    7    10*     > RETURN                                                       null

End of function __get

Function __set:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/e62A6
function name:  __set
number of ops:  8
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   10     2        CONCAT                                               ~2      'Set%3A+', !0
          3        CONCAT                                               ~3      ~2, '+to+'
          4        CONCAT                                               ~4      ~3, !1
          5        CONCAT                                               ~5      ~4, '%0A'
          6        ECHO                                                         ~5
   11     7      > RETURN                                                       null

End of function __set

End of class Smth.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.1 ms | 1918 KiB | 13 Q