3v4l.org

run code in 300+ PHP versions simultaneously
<?php [5.5][0]; class ob { private $b = false; public function __construct($b=false) { if ($b) $this->b = $b; } public function __toString(){ return $this->b?'1':'0'; } } $ob = new ob(); $ob2 = new ob(true); if (true == (string)$ob) echo 'ob/'; if (true == (string)$ob2) echo 'ob2/';
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 18
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
Branch analysis from position: 14
filename:       /in/gNdWe
function name:  (null)
number of ops:  19
compiled vars:  !0 = $ob, !1 = $ob2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   FETCH_DIM_R                                      ~2      <array>, 0
          1        FREE                                                     ~2
    3     2        DECLARE_CLASS                                            'ob'
   12     3        NEW                                              $3      'ob'
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $3
   13     6        NEW                                              $6      'ob'
          7        SEND_VAL_EX                                              <true>
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   14    10        CAST                                          6  ~9      !0
         11        BOOL                                             ~10     ~9
         12      > JMPZ                                                     ~10, ->14
         13    >   ECHO                                                     'ob%2F'
   15    14    >   CAST                                          6  ~11     !1
         15        BOOL                                             ~12     ~11
         16      > JMPZ                                                     ~12, ->18
         17    >   ECHO                                                     'ob2%2F'
         18    > > RETURN                                                   1

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

End of function __construct

Function __tostring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 4
Branch analysis from position: 2
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/gNdWe
function name:  __toString
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   FETCH_OBJ_R                                      ~0      'b'
          1      > JMPZ                                                     ~0, ->4
          2    >   QM_ASSIGN                                        ~1      '1'
          3      > JMP                                                      ->5
          4    >   QM_ASSIGN                                        ~1      '0'
          5    >   VERIFY_RETURN_TYPE                                       ~1
          6      > RETURN                                                   ~1
   10     7*       VERIFY_RETURN_TYPE                                       
          8*     > RETURN                                                   null

End of function __tostring

End of class ob.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.01 ms | 1399 KiB | 13 Q