3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $id = 123; public function __construct($id) { $this->id = $id; } public function getID() { return $this->id; } } class Bar extends Foo { private $what = 'running'; private $sleeping = 3; public function __sleep() { return array('sleeping'); } public function __wakeup() { $this->what = 'awake'; } } $x = new Foo(42); echo serialize($x) . "\n"; $y = new Bar(42); echo serialize($y);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkMVF
function name:  (null)
number of ops:  18
compiled vars:  !0 = $x, !1 = $y
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $2      'Foo'
          1        SEND_VAL_EX                                              42
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   23     4        INIT_FCALL                                               'serialize'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      $5, '%0A'
          8        ECHO                                                     ~6
   25     9        NEW                                              $7      'Bar'
         10        SEND_VAL_EX                                              42
         11        DO_FCALL                                      0          
         12        ASSIGN                                                   !1, $7
   26    13        INIT_FCALL                                               'serialize'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $10     
         16        ECHO                                                     $10
         17      > RETURN                                                   1

Class Foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkMVF
function name:  __construct
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

Function getid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkMVF
function name:  getID
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'id'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function getid

End of class Foo.

Class Bar:
Function __sleep:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkMVF
function name:  __sleep
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E > > RETURN                                                   <array>
   17     1*     > RETURN                                                   null

End of function __sleep

Function __wakeup:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkMVF
function name:  __wakeup
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   ASSIGN_OBJ                                               'what'
          1        OP_DATA                                                  'awake'
   20     2      > RETURN                                                   null

End of function __wakeup

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkMVF
function name:  __construct
number of ops:  4
compiled vars:  !0 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        ASSIGN_OBJ                                               'id'
          2        OP_DATA                                                  !0
    7     3      > RETURN                                                   null

End of function __construct

Function getid:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qkMVF
function name:  getID
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'id'
          1      > RETURN                                                   ~0
   10     2*     > RETURN                                                   null

End of function getid

End of class Bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.12 ms | 1405 KiB | 15 Q