3v4l.org

run code in 300+ PHP versions simultaneously
<?php $mem = memory_get_usage(); $a = str_repeat('A',1048576); $mema = memory_get_usage() - $mem; $b = 1 ? $a : 0; $memb = memory_get_usage() - $mem; printf( '%1.1f', $memb / $mema );
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Acb6d
function name:  (null)
number of ops:  27
compiled vars:  !0 = $mem, !1 = $a, !2 = $mema, !3 = $b, !4 = $memb
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'memory_get_usage'
          1        DO_ICALL                                         $5      
          2        ASSIGN                                                   !0, $5
    4     3        INIT_FCALL                                               'str_repeat'
          4        SEND_VAL                                                 'A'
          5        SEND_VAL                                                 1048576
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !1, $7
    5     8        INIT_FCALL                                               'memory_get_usage'
          9        DO_ICALL                                         $9      
         10        SUB                                              ~10     $9, !0
         11        ASSIGN                                                   !2, ~10
    6    12      > JMPZ                                                     1, ->15
         13    >   QM_ASSIGN                                        ~12     !1
         14      > JMP                                                      ->16
         15    >   QM_ASSIGN                                        ~12     0
         16    >   ASSIGN                                                   !3, ~12
    7    17        INIT_FCALL                                               'memory_get_usage'
         18        DO_ICALL                                         $14     
         19        SUB                                              ~15     $14, !0
         20        ASSIGN                                                   !4, ~15
    9    21        INIT_FCALL                                               'printf'
         22        SEND_VAL                                                 '%251.1f'
         23        DIV                                              ~17     !4, !2
         24        SEND_VAL                                                 ~17
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.13 ms | 1395 KiB | 19 Q