3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { private $foo = 'bar'; } class B extends A { public function setFoo($foo) { return $this->{chr(0) . 'A' . chr(0) . 'foo'} = $foo; } public function getFoo() { return $this->{chr(0) . 'A' . chr(0) . 'foo'}; } } $b = new B(); $b->setFoo('baz'); var_dump($b->getFoo());
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/UD3A3
function name:  (null)
number of ops:  15
compiled vars:  !0 = $b
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
   8     1        NOP                                                      
         2        NOP                                                      
  20     3        NEW                                              $4      :-4
         4        DO_FCALL                                      0          
         5        ASSIGN                                                   !0, $4
  22     6        INIT_METHOD_CALL                                         !0, 'setFoo'
         7        SEND_VAL_EX                                              'baz'
         8        DO_FCALL                                      0          
  23     9        INIT_FCALL                                               'var_dump'
        10        INIT_METHOD_CALL                                         !0, 'getFoo'
        11        DO_FCALL                                      0  $8      
        12        SEND_VAR                                                 $8
        13        DO_ICALL                                                 
        14      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function setfoo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/UD3A3
function name:  setFoo
number of ops:  14
compiled vars:  !0 = $foo
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  10     0  E >   RECV                                             !0      
  12     1        INIT_FCALL                                               'chr'
         2        SEND_VAL                                                 0
         3        DO_ICALL                                         $1      
         4        CONCAT                                           ~2      $1, 'A'
         5        INIT_FCALL                                               'chr'
         6        SEND_VAL                                                 0
         7        DO_ICALL                                         $3      
         8        CONCAT                                           ~4      ~2, $3
         9        CONCAT                                           ~5      ~4, 'foo'
        10        ASSIGN_OBJ                                       $6      ~5
        11        OP_DATA                                                  !0
        12      > RETURN                                                   $6
  13    13*     > RETURN                                                   null

End of function setfoo

Function getfoo:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/UD3A3
function name:  getFoo
number of ops:  12
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  16     0  E >   INIT_FCALL                                               'chr'
         1        SEND_VAL                                                 0
         2        DO_ICALL                                         $0      
         3        CONCAT                                           ~1      $0, 'A'
         4        INIT_FCALL                                               'chr'
         5        SEND_VAL                                                 0
         6        DO_ICALL                                         $2      
         7        CONCAT                                           ~3      ~1, $2
         8        CONCAT                                           ~4      ~3, 'foo'
         9        FETCH_OBJ_R                                      $5      ~4
        10      > RETURN                                                   $5
  17    11*     > RETURN                                                   null

End of function getfoo

End of class B.

Generated using Vulcan Logic Dumper, using php 7.2.0