3v4l.org

run code in 300+ PHP versions simultaneously
<?php error_reporting(E_ALL); ini_set('display_errors', 1); function calcmem($n) { return round(pow($n, 2) / (8 * 1024 * 1024), 2); } function println($str) { echo $str."\n"; } $n = 1000; println(calcmem($n).' Mo');; println($n * $n); println(8*1024*1024); println(($n*$n)/(8*1024*1024)); echo round(($n * $n) / (8*1024*1024), 2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBmUQ
function name:  (null)
number of ops:  35
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'error_reporting'
          1        SEND_VAL                                                 32767
          2        DO_ICALL                                                 
    4     3        INIT_FCALL                                               'ini_set'
          4        SEND_VAL                                                 'display_errors'
          5        SEND_VAL                                                 1
          6        DO_ICALL                                                 
   14     7        ASSIGN                                                   !0, 1000
   16     8        INIT_FCALL                                               'println'
          9        INIT_FCALL                                               'calcmem'
         10        SEND_VAR                                                 !0
         11        DO_FCALL                                      0  $4      
         12        CONCAT                                           ~5      $4, '+Mo'
         13        SEND_VAL                                                 ~5
         14        DO_FCALL                                      0          
   18    15        INIT_FCALL                                               'println'
         16        MUL                                              ~7      !0, !0
         17        SEND_VAL                                                 ~7
         18        DO_FCALL                                      0          
   19    19        INIT_FCALL                                               'println'
         20        SEND_VAL                                                 8388608
         21        DO_FCALL                                      0          
   20    22        INIT_FCALL                                               'println'
         23        MUL                                              ~10     !0, !0
         24        DIV                                              ~11     ~10, 8388608
         25        SEND_VAL                                                 ~11
         26        DO_FCALL                                      0          
   22    27        INIT_FCALL                                               'round'
         28        MUL                                              ~13     !0, !0
         29        DIV                                              ~14     ~13, 8388608
         30        SEND_VAL                                                 ~14
         31        SEND_VAL                                                 2
         32        DO_ICALL                                         $15     
         33        ECHO                                                     $15
         34      > RETURN                                                   1

Function calcmem:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBmUQ
function name:  calcmem
number of ops:  12
compiled vars:  !0 = $n
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        INIT_FCALL                                               'round'
          2        INIT_FCALL                                               'pow'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 2
          5        DO_ICALL                                         $1      
          6        DIV                                              ~2      $1, 8388608
          7        SEND_VAL                                                 ~2
          8        SEND_VAL                                                 2
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
    8    11*     > RETURN                                                   null

End of function calcmem

Function println:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBmUQ
function name:  println
number of ops:  4
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1        CONCAT                                           ~1      !0, '%0A'
          2        ECHO                                                     ~1
   12     3      > RETURN                                                   null

End of function println

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.1 ms | 1402 KiB | 26 Q