3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Smth { public function __get($name) { echo "Get: $name\n"; return $name == "abc" ? null : 0; } 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/GKlnG
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 = 7, Position 2 = 9
Branch analysis from position: 7
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: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/GKlnG
function name:  __get
number of ops:  12
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        ROPE_INIT                                     3  ~2      'Get%3A+'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%0A'
          4        ECHO                                                     ~1
    6     5        IS_EQUAL                                                 !0, 'abc'
          6      > JMPZ                                                     ~4, ->9
          7    >   QM_ASSIGN                                        ~5      null
          8      > JMP                                                      ->10
          9    >   QM_ASSIGN                                        ~5      0
         10    > > RETURN                                                   ~5
    7    11*     > 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/GKlnG
function name:  __set
number of ops:  9
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        ROPE_INIT                                     5  ~3      'Set%3A+'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '+to+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '%0A'
          7        ECHO                                                     ~2
   11     8      > RETURN                                                   null

End of function __set

End of class Smth.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.65 ms | 1002 KiB | 13 Q