3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = 11; $bar = 12; //optimal: memory used once $foo = $foo ^ $bar; $bar = $foo ^ $bar; $foo = $foo ^ $bar; var_dump($foo, $bar); echo memory_get_peak_usage(); $foo = 11; $bar = 12; //readable: $baz = $foo; $foo = $bar; $bar = $baz; // var_dump($foo, $bar); echo memory_get_peak_usage();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lSelg
function name:  (null)
number of ops:  28
compiled vars:  !0 = $foo, !1 = $bar, !2 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 11
    4     1        ASSIGN                                                   !1, 12
    6     2        BW_XOR                                           ~5      !0, !1
          3        ASSIGN                                                   !0, ~5
    7     4        BW_XOR                                           ~7      !0, !1
          5        ASSIGN                                                   !1, ~7
    8     6        BW_XOR                                           ~9      !0, !1
          7        ASSIGN                                                   !0, ~9
    9     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                                 
   10    12        INIT_FCALL                                               'memory_get_peak_usage'
         13        DO_ICALL                                         $12     
         14        ECHO                                                     $12
   12    15        ASSIGN                                                   !0, 11
   13    16        ASSIGN                                                   !1, 12
   15    17        ASSIGN                                                   !2, !0
   16    18        ASSIGN                                                   !0, !1
   17    19        ASSIGN                                                   !1, !2
   19    20        INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !0
         22        SEND_VAR                                                 !1
         23        DO_ICALL                                                 
   20    24        INIT_FCALL                                               'memory_get_peak_usage'
         25        DO_ICALL                                         $19     
         26        ECHO                                                     $19
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.48 ms | 1383 KiB | 17 Q