3v4l.org

run code in 300+ PHP versions simultaneously
<?php // r() simply returns a reference to a given variable. function &r(&$v){return $v;} // Here, we have a scalar $a on which settype() fails to operate if // parentheses are involved. print "Scalar demonstration:\n"; $a = 1; // First with parentheses, then without. // v v settype( ( r($a) ) , "boolean"); var_dump($a); settype( r($a) , "boolean"); var_dump($a); // ^ ^
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/RPGZO
function name:  (null)
number of ops:  23
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   ECHO                                                     'Scalar+demonstration%3A%0A'
   10     1        ASSIGN                                                   !0, 1
   14     2        INIT_FCALL                                               'settype'
          3        INIT_FCALL                                               'r'
          4        SEND_REF                                                 !0
          5        DO_FCALL                                      0  $2      
          6        SEND_VAR_NO_REF                               0          $2
          7        SEND_VAL                                                 'boolean'
          8        DO_ICALL                                                 
          9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                                 
   15    12        INIT_FCALL                                               'settype'
         13        INIT_FCALL                                               'r'
         14        SEND_REF                                                 !0
         15        DO_FCALL                                      0  $5      
         16        SEND_VAR_NO_REF                               0          $5
         17        SEND_VAL                                                 'boolean'
         18        DO_ICALL                                                 
         19        INIT_FCALL                                               'var_dump'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
   16    22      > RETURN                                                   1

Function r:
Finding entry points
Branch analysis from position: 0
Return found
filename:       /in/RPGZO
function name:  r
number of ops:  3
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1      > RETURN_BY_REF                                            !0
          2*     > RETURN_BY_REF                                            null

End of function r

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
188.93 ms | 1397 KiB | 19 Q