3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { private $string; private $int; private $bool; function __construct() { $this->string = "Nabir"; $this->int = 19; $this->bool = true; } function printDetails() { $genderCheck = ($this->bool == true ? "true" : "false"); return printf("Hello! My name is %s, I am %d years old and it is $genderCheck that I am a male.", $this->string, $this->int); } } $instance = new Example(); echo $instance->printDetails(); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/11HDp
function name:  (null)
number of ops:  7
compiled vars:  !0 = $instance
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   27     0  E >   NEW                                              $1      'Example'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   28     3        INIT_METHOD_CALL                                         !0, 'printDetails'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   30     6      > RETURN                                                   1

Class Example:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/11HDp
function name:  __construct
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   ASSIGN_OBJ                                               'string'
          1        OP_DATA                                                  'Nabir'
   13     2        ASSIGN_OBJ                                               'int'
          3        OP_DATA                                                  19
   14     4        ASSIGN_OBJ                                               'bool'
          5        OP_DATA                                                  <true>
   16     6      > RETURN                                                   null

End of function __construct

Function printdetails:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/11HDp
function name:  printDetails
number of ops:  19
compiled vars:  !0 = $genderCheck
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   FETCH_OBJ_R                                      ~1      'bool'
          1        BOOL                                             ~2      ~1
          2      > JMPZ                                                     ~2, ->5
          3    >   QM_ASSIGN                                        ~3      'true'
          4      > JMP                                                      ->6
          5    >   QM_ASSIGN                                        ~3      'false'
          6    >   ASSIGN                                                   !0, ~3
   21     7        INIT_FCALL                                               'printf'
          8        ROPE_INIT                                     3  ~6      'Hello%21+My+name+is+%25s%2C+I+am+%25d+years+old+and+it+is+'
          9        ROPE_ADD                                      1  ~6      ~6, !0
         10        ROPE_END                                      2  ~5      ~6, '+that+I+am+a+male.'
         11        SEND_VAL                                                 ~5
         12        FETCH_OBJ_R                                      ~8      'string'
         13        SEND_VAL                                                 ~8
         14        FETCH_OBJ_R                                      ~9      'int'
         15        SEND_VAL                                                 ~9
         16        DO_ICALL                                         $10     
         17      > RETURN                                                   $10
   23    18*     > RETURN                                                   null

End of function printdetails

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.27 ms | 1392 KiB | 15 Q