3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Gender extends SplEnum { const MALE = 1 , FEMALE = 2 ; } // define a Person object with name, age and gender properties class Person { private $name , $age , $gender ; public function __construct($name, $age, Gender $gender) { $this->name = $name; $this->age = (int) $age; $this->gender = $gender; } public function isMale() { return ($this->gender == Gender::MALE); } public function isFemale() { return ($this->gender == Gender::FEMALE); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/98BFf
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'gender', 'splenum'
   36     1      > RETURN                                                   1

Class Gender: [no user functions]
Class Person:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/98BFf
function name:  __construct
number of ops:  11
compiled vars:  !0 = $name, !1 = $age, !2 = $gender
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   22     3        ASSIGN_OBJ                                               'name'
          4        OP_DATA                                                  !0
   23     5        CAST                                          4  ~5      !1
          6        ASSIGN_OBJ                                               'age'
          7        OP_DATA                                                  ~5
   24     8        ASSIGN_OBJ                                               'gender'
          9        OP_DATA                                                  !2
   25    10      > RETURN                                                   null

End of function __construct

Function ismale:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/98BFf
function name:  isMale
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   FETCH_OBJ_R                                      ~0      'gender'
          1        FETCH_CLASS_CONSTANT                             ~1      'Gender', 'MALE'
          2        IS_EQUAL                                         ~2      ~0, ~1
          3      > RETURN                                                   ~2
   30     4*     > RETURN                                                   null

End of function ismale

Function isfemale:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/98BFf
function name:  isFemale
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   34     0  E >   FETCH_OBJ_R                                      ~0      'gender'
          1        FETCH_CLASS_CONSTANT                             ~1      'Gender', 'FEMALE'
          2        IS_EQUAL                                         ~2      ~0, ~1
          3      > RETURN                                                   ~2
   35     4*     > RETURN                                                   null

End of function isfemale

End of class Person.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.28 ms | 1395 KiB | 13 Q