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($name, $value)\n"; if(is_bool($value)) { boolToStr($value); } $this->$name = $value; } function __get($name) { print "__get($name)\n"; } } $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/KlfIU
function name:  (null)
number of ops:  14
compiled vars:  !0 = $t1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        ASSIGN_OBJ                                               !0, 'param'
          4        OP_DATA                                                  <true>
   25     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   26     8        ASSIGN_OBJ                                               !0, 'param'
          9        OP_DATA                                                  <false>
   27    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/KlfIU
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 = 10, Position 2 = 13
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
filename:       /in/KlfIU
function name:  __set
number of ops:  16
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        ROPE_INIT                                     5  ~3      '__set%28'
          3        ROPE_ADD                                      1  ~3      ~3, !0
          4        ROPE_ADD                                      2  ~3      ~3, '%2C+'
          5        ROPE_ADD                                      3  ~3      ~3, !1
          6        ROPE_END                                      4  ~2      ~3, '%29%0A'
          7        ECHO                                                     ~2
   14     8        TYPE_CHECK                                   12          !1
          9      > JMPZ                                                     ~6, ->13
   15    10    >   INIT_FCALL                                               'booltostr'
         11        SEND_REF                                                 !1
         12        DO_FCALL                                      0          
   17    13    >   ASSIGN_OBJ                                               !0
         14        OP_DATA                                                  !1
   18    15      > RETURN                                                   null

End of function __set

Function __get:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KlfIU
function name:  __get
number of ops:  6
compiled vars:  !0 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   RECV                                             !0      
   20     1        ROPE_INIT                                     3  ~2      '__get%28'
          2        ROPE_ADD                                      1  ~2      ~2, !0
          3        ROPE_END                                      2  ~1      ~2, '%29%0A'
          4        ECHO                                                     ~1
   21     5      > RETURN                                                   null

End of function __get

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.38 ms | 1403 KiB | 16 Q