3v4l.org

run code in 300+ PHP versions simultaneously
<?php // attiva alcuni errori, definendo prima un array misto con elementi non numerici echo "vector a\n"; $a = array(2,3,"foo",5.5,43.3,21.11); print_r($a); // genera il secondo array, generando un avviso echo "----\nvector b - a warning (b = log(PI) * a)\n"; $b = scale_by_log($a, M_PI); print_r($b); // questo è il problema, passiamo una stringa al posto di un array echo "----\nvector c - an error\n"; $c = scale_by_log("not array",2.3); var_dump($c); // errore critico, il log di zero o di un numero negativo non è definito echo "----\nvector d - fatal error\n"; $d = scale_by_log($a, -2.5); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bgAK7
function name:  (null)
number of ops:  30
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $d
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'vector+a%0A'
    6     1        ASSIGN                                                   !0, <array>
    7     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
   10     5        ECHO                                                     '----%0Avector+b+-+a+warning+%28b+%3D+log%28PI%29+%2A+a%29%0A'
   11     6        INIT_FCALL_BY_NAME                                       'scale_by_log'
          7        SEND_VAR_EX                                              !0
          8        SEND_VAL_EX                                              3.14159
          9        DO_FCALL                                      0  $6      
         10        ASSIGN                                                   !1, $6
   12    11        INIT_FCALL                                               'print_r'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
   15    14        ECHO                                                     '----%0Avector+c+-+an+error%0A'
   16    15        INIT_FCALL_BY_NAME                                       'scale_by_log'
         16        SEND_VAL_EX                                              'not+array'
         17        SEND_VAL_EX                                              2.3
         18        DO_FCALL                                      0  $9      
         19        ASSIGN                                                   !2, $9
   17    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
   20    23        ECHO                                                     '----%0Avector+d+-+fatal+error%0A'
   21    24        INIT_FCALL_BY_NAME                                       'scale_by_log'
         25        SEND_VAR_EX                                              !0
         26        SEND_VAL_EX                                              -2.5
         27        DO_FCALL                                      0  $12     
         28        ASSIGN                                                   !3, $12
   23    29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.46 ms | 1400 KiB | 17 Q