3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public $test = true; public function isTest($test_flag = null){ if(func_num_args()){ $this->test = !!$test_flag; return $this; } return $this->test; } } $t = new Test; var_dump($t->isTest()); var_dump($t->isTest(false)); var_dump($t->isTest()); var_dump($t->isTest(true)); var_dump($t->isTest()); var_dump($t->isTest(null)); var_dump($t->isTest());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecppa
function name:  (null)
number of ops:  42
compiled vars:  !0 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   16     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'isTest'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
   18     8        INIT_FCALL                                               'var_dump'
          9        INIT_METHOD_CALL                                         !0, 'isTest'
         10        SEND_VAL_EX                                              <false>
         11        DO_FCALL                                      0  $6      
         12        SEND_VAR                                                 $6
         13        DO_ICALL                                                 
   20    14        INIT_FCALL                                               'var_dump'
         15        INIT_METHOD_CALL                                         !0, 'isTest'
         16        DO_FCALL                                      0  $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
   22    19        INIT_FCALL                                               'var_dump'
         20        INIT_METHOD_CALL                                         !0, 'isTest'
         21        SEND_VAL_EX                                              <true>
         22        DO_FCALL                                      0  $10     
         23        SEND_VAR                                                 $10
         24        DO_ICALL                                                 
   24    25        INIT_FCALL                                               'var_dump'
         26        INIT_METHOD_CALL                                         !0, 'isTest'
         27        DO_FCALL                                      0  $12     
         28        SEND_VAR                                                 $12
         29        DO_ICALL                                                 
   26    30        INIT_FCALL                                               'var_dump'
         31        INIT_METHOD_CALL                                         !0, 'isTest'
         32        SEND_VAL_EX                                              null
         33        DO_FCALL                                      0  $14     
         34        SEND_VAR                                                 $14
         35        DO_ICALL                                                 
   28    36        INIT_FCALL                                               'var_dump'
         37        INIT_METHOD_CALL                                         !0, 'isTest'
         38        DO_FCALL                                      0  $16     
         39        SEND_VAR                                                 $16
         40        DO_ICALL                                                 
         41      > RETURN                                                   1

Class Test:
Function istest:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 9
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ecppa
function name:  isTest
number of ops:  12
compiled vars:  !0 = $test_flag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      null
    6     1        FUNC_NUM_ARGS                                    ~1      
          2      > JMPZ                                                     ~1, ->9
    7     3    >   BOOL_NOT                                         ~3      !0
          4        BOOL_NOT                                         ~4      ~3
          5        ASSIGN_OBJ                                               'test'
          6        OP_DATA                                                  ~4
    8     7        FETCH_THIS                                       ~5      
          8      > RETURN                                                   ~5
   10     9    >   FETCH_OBJ_R                                      ~6      'test'
         10      > RETURN                                                   ~6
   11    11*     > RETURN                                                   null

End of function istest

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
203.05 ms | 1400 KiB | 15 Q