3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_exception_handler(function(Exception $e) { echo "Didn't work. Here's why: ". $e->getMessage() . PHP_EOL; }); function tryAndDump($array) { var_dump(SplFixedArray::fromArray($array)); var_dump(SplFixedArray::fromArray($array, true)); var_dump(SplFixedArray::fromArray($array, false)); } $null = null; $empty = array(); $norm = array(1, 2, 4); $assoc = array('yup' => 'ok', 'nope' => 'bad'); $mixed = array(1, 2, 'yup' => 'ok', 'nah'); tryAndDump($null); tryAndDump($empty); tryAndDump($norm); tryAndDump($assoc); tryAndDump($mixed);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqS6K
function name:  (null)
number of ops:  25
compiled vars:  !0 = $null, !1 = $empty, !2 = $norm, !3 = $assoc, !4 = $mixed
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FQqS6K%3A3%240'
    5     2        SEND_VAL                                                 ~5
          3        DO_ICALL                                                 
   13     4        ASSIGN                                                   !0, null
   14     5        ASSIGN                                                   !1, <array>
   15     6        ASSIGN                                                   !2, <array>
   16     7        ASSIGN                                                   !3, <array>
   17     8        ASSIGN                                                   !4, <array>
   19     9        INIT_FCALL                                               'tryanddump'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0          
   20    12        INIT_FCALL                                               'tryanddump'
         13        SEND_VAR                                                 !1
         14        DO_FCALL                                      0          
   21    15        INIT_FCALL                                               'tryanddump'
         16        SEND_VAR                                                 !2
         17        DO_FCALL                                      0          
   22    18        INIT_FCALL                                               'tryanddump'
         19        SEND_VAR                                                 !3
         20        DO_FCALL                                      0          
   23    21        INIT_FCALL                                               'tryanddump'
         22        SEND_VAR                                                 !4
         23        DO_FCALL                                      0          
         24      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FQqS6K%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqS6K
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_METHOD_CALL                                         !0, 'getMessage'
          2        DO_FCALL                                      0  $1      
          3        CONCAT                                           ~2      'Didn%27t+work.+Here%27s+why%3A+', $1
          4        CONCAT                                           ~3      ~2, '%0A'
          5        ECHO                                                     ~3
    5     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FQqS6K%3A3%240

Function tryanddump:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QqS6K
function name:  tryAndDump
number of ops:  22
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'var_dump'
          2        INIT_STATIC_METHOD_CALL                                  'SplFixedArray', 'fromArray'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
    9     7        INIT_FCALL                                               'var_dump'
          8        INIT_STATIC_METHOD_CALL                                  'SplFixedArray', 'fromArray'
          9        SEND_VAR                                                 !0
         10        SEND_VAL                                                 <true>
         11        DO_FCALL                                      0  $3      
         12        SEND_VAR                                                 $3
         13        DO_ICALL                                                 
   10    14        INIT_FCALL                                               'var_dump'
         15        INIT_STATIC_METHOD_CALL                                  'SplFixedArray', 'fromArray'
         16        SEND_VAR                                                 !0
         17        SEND_VAL                                                 <false>
         18        DO_FCALL                                      0  $5      
         19        SEND_VAR                                                 $5
         20        DO_ICALL                                                 
   11    21      > RETURN                                                   null

End of function tryanddump

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.22 ms | 1394 KiB | 22 Q