3v4l.org

run code in 300+ PHP versions simultaneously
<?php class test { function __toString() { return 'hello'; } } var_dump(is_scalar(null)); var_dump(is_scalar(array())); var_dump(is_scalar('null')); var_dump(is_scalar(0)); var_dump(is_scalar(1)); var_dump(is_scalar(1.2)); var_dump(is_scalar(new test()));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/55EeN
function name:  (null)
number of ops:  32
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'test'
    9     1        INIT_FCALL                                               'var_dump'
          2        TYPE_CHECK                                  124  ~0      null
          3        SEND_VAL                                                 ~0
          4        DO_ICALL                                                 
   10     5        INIT_FCALL                                               'var_dump'
          6        TYPE_CHECK                                  124  ~2      <array>
          7        SEND_VAL                                                 ~2
          8        DO_ICALL                                                 
   11     9        INIT_FCALL                                               'var_dump'
         10        TYPE_CHECK                                  124  ~4      'null'
         11        SEND_VAL                                                 ~4
         12        DO_ICALL                                                 
   12    13        INIT_FCALL                                               'var_dump'
         14        TYPE_CHECK                                  124  ~6      0
         15        SEND_VAL                                                 ~6
         16        DO_ICALL                                                 
   13    17        INIT_FCALL                                               'var_dump'
         18        TYPE_CHECK                                  124  ~8      1
         19        SEND_VAL                                                 ~8
         20        DO_ICALL                                                 
   14    21        INIT_FCALL                                               'var_dump'
         22        TYPE_CHECK                                  124  ~10     1.2
         23        SEND_VAL                                                 ~10
         24        DO_ICALL                                                 
   15    25        INIT_FCALL                                               'var_dump'
         26        NEW                                              $12     'test'
         27        DO_FCALL                                      0          
         28        TYPE_CHECK                                  124  ~14     $12
         29        SEND_VAL                                                 ~14
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Class test:
Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/55EeN
function name:  __toString
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'hello'
    6     1*       VERIFY_RETURN_TYPE                                       
          2*     > RETURN                                                   null

End of function __tostring

End of class test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.7 ms | 1396 KiB | 15 Q