3v4l.org

run code in 300+ PHP versions simultaneously
<?php function boolToStr(&$value) { if($value === true) { $value = 't'; } elseif($value === false) { $value = 'f'; } } class Test { function __set($name, $value) { print '__set()'; if(is_bool($value)) { boolToStr($value); } $this->$name = $value; } } $t1 = new Test(); $t1->param = true; var_dump($t1); $t1->param = false; var_dump($t1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jAbRD
function name:  (null)
number of ops:  14
compiled vars:  !0 = $t1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   21     3        ASSIGN_OBJ                                               !0, 'param'
          4        OP_DATA                                                  <true>
   22     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   23     8        ASSIGN_OBJ                                               !0, 'param'
          9        OP_DATA                                                  <false>
   24    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Function booltostr:
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 = 8
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/jAbRD
function name:  boolToStr
number of ops:  9
compiled vars:  !0 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        TYPE_CHECK                                    8          !0
          2      > JMPZ                                                     ~1, ->5
    4     3    >   ASSIGN                                                   !0, 't'
          4      > JMP                                                      ->8
    6     5    >   TYPE_CHECK                                    4          !0
          6      > JMPZ                                                     ~3, ->8
    7     7    >   ASSIGN                                                   !0, 'f'
    9     8    > > RETURN                                                   null

End of function booltostr

Class Test:
Function __set:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 8
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
filename:       /in/jAbRD
function name:  __set
number of ops:  11
compiled vars:  !0 = $name, !1 = $value
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   13     2        ECHO                                                     '__set%28%29'
   14     3        TYPE_CHECK                                   12          !1
          4      > JMPZ                                                     ~2, ->8
   15     5    >   INIT_FCALL                                               'booltostr'
          6        SEND_REF                                                 !1
          7        DO_FCALL                                      0          
   17     8    >   ASSIGN_OBJ                                               !0
          9        OP_DATA                                                  !1
   18    10      > RETURN                                                   null

End of function __set

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.02 ms | 1402 KiB | 16 Q