3v4l.org

run code in 300+ PHP versions simultaneously
<?php class cls { protected $active = 'false'; public function __construct() { $this->active = 'active'; } public function activate() { $this->active = 'active'; } public function deactivate() { $this->active = 'inactive'; } public function isActive() { return $this->active === 'active'; } public function __toString() { return sprintf('<li class="%s"></li>', $this->active); } } echo new cls;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTtvr
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'cls'
   31     1        NEW                                              $0      'cls'
          2        DO_FCALL                                      0          
          3        ECHO                                                     $0
          4      > RETURN                                                   1

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

End of function __construct

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

End of function activate

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

End of function deactivate

Function isactive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTtvr
function name:  isActive
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   FETCH_OBJ_R                                      ~0      'active'
          1        IS_IDENTICAL                                     ~1      ~0, 'active'
          2      > RETURN                                                   ~1
   23     3*     > RETURN                                                   null

End of function isactive

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hTtvr
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   INIT_FCALL                                               'sprintf'
          1        SEND_VAL                                                 '%3Cli+class%3D%22%25s%22%3E%3C%2Fli%3E'
          2        FETCH_OBJ_R                                      ~0      'active'
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                         $1      
          5        VERIFY_RETURN_TYPE                                       $1
          6      > RETURN                                                   $1
   28     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

End of class cls.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.37 ms | 1003 KiB | 14 Q