3v4l.org

run code in 300+ PHP versions simultaneously
<?php function myfunction1 ( $param ) {} echo (new ReflectionFunction("myfunction1"))->getParameters()[0]->allowsNull() ? "true\n" : "false\n"; function myfunction2 ( stdClass $param ) { } echo (new ReflectionFunction("myfunction2"))->getParameters()[0]->allowsNull() ? "true\n" : "false\n"; function myfunction3 ( stdClass $param = null ) { } echo (new ReflectionFunction("myfunction3"))->getParameters()[0]->allowsNull() ? "true\n" : "false\n"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
Branch analysis from position: 37
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 24
Branch analysis from position: 22
Branch analysis from position: 24
filename:       /in/TorV2
function name:  (null)
number of ops:  40
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $0      'ReflectionFunction'
          1        SEND_VAL_EX                                              'myfunction1'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $0, 'getParameters'
          4        DO_FCALL                                      0  $2      
          5        FETCH_DIM_R                                      ~3      $2, 0
          6        INIT_METHOD_CALL                                         ~3, 'allowsNull'
          7        DO_FCALL                                      0  $4      
          8      > JMPZ                                                     $4, ->11
          9    >   QM_ASSIGN                                        ~5      'true%0A'
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~5      'false%0A'
         12    >   ECHO                                                     ~5
    6    13        NEW                                              $6      'ReflectionFunction'
         14        SEND_VAL_EX                                              'myfunction2'
         15        DO_FCALL                                      0          
         16        INIT_METHOD_CALL                                         $6, 'getParameters'
         17        DO_FCALL                                      0  $8      
         18        FETCH_DIM_R                                      ~9      $8, 0
         19        INIT_METHOD_CALL                                         ~9, 'allowsNull'
         20        DO_FCALL                                      0  $10     
         21      > JMPZ                                                     $10, ->24
         22    >   QM_ASSIGN                                        ~11     'true%0A'
         23      > JMP                                                      ->25
         24    >   QM_ASSIGN                                        ~11     'false%0A'
         25    >   ECHO                                                     ~11
    9    26        NEW                                              $12     'ReflectionFunction'
         27        SEND_VAL_EX                                              'myfunction3'
         28        DO_FCALL                                      0          
         29        INIT_METHOD_CALL                                         $12, 'getParameters'
         30        DO_FCALL                                      0  $14     
         31        FETCH_DIM_R                                      ~15     $14, 0
         32        INIT_METHOD_CALL                                         ~15, 'allowsNull'
         33        DO_FCALL                                      0  $16     
         34      > JMPZ                                                     $16, ->37
         35    >   QM_ASSIGN                                        ~17     'true%0A'
         36      > JMP                                                      ->38
         37    >   QM_ASSIGN                                        ~17     'false%0A'
         38    >   ECHO                                                     ~17
   10    39      > RETURN                                                   1

Function myfunction1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TorV2
function name:  myfunction1
number of ops:  2
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function myfunction1

Function myfunction2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TorV2
function name:  myfunction2
number of ops:  2
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function myfunction2

Function myfunction3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TorV2
function name:  myfunction3
number of ops:  2
compiled vars:  !0 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV_INIT                                        !0      null
          1      > RETURN                                                   null

End of function myfunction3

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
198.17 ms | 1399 KiB | 13 Q