3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * Getting MAC Address using PHP * Md. Nazmul Basher */ ob_start(); // Turn on output buffering system(‘ipconfig /all’); //Execute external program to display output $mycom=ob_get_contents(); // Capture the output into a variable ob_clean(); // Clean (erase) the output buffer $findme = “Physical”; $pmac = strpos($mycom, $findme); // Find the position of Physical text $mac=substr($mycom,($pmac+36),17); // Get Physical Address echo $mac;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uufpM
function name:  (null)
number of ops:  29
compiled vars:  !0 = $mycom, !1 = $findme, !2 = $pmac, !3 = $mac
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'ob_start'
          1        DO_ICALL                                                 
    8     2        INIT_FCALL                                               'system'
          3        FETCH_CONSTANT                                   ~5      '%E2%80%98ipconfig'
          4        FETCH_CONSTANT                                   ~6      'all%E2%80%99'
          5        DIV                                              ~7      ~5, ~6
          6        SEND_VAL                                                 ~7
          7        DO_ICALL                                                 
    9     8        INIT_FCALL                                               'ob_get_contents'
          9        DO_ICALL                                         $9      
         10        ASSIGN                                                   !0, $9
   10    11        INIT_FCALL                                               'ob_clean'
         12        DO_ICALL                                                 
   12    13        FETCH_CONSTANT                                   ~12     '%E2%80%9CPhysical%E2%80%9D'
         14        ASSIGN                                                   !1, ~12
   13    15        INIT_FCALL                                               'strpos'
         16        SEND_VAR                                                 !0
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $14     
         19        ASSIGN                                                   !2, $14
   14    20        INIT_FCALL                                               'substr'
         21        SEND_VAR                                                 !0
         22        ADD                                              ~16     !2, 36
         23        SEND_VAL                                                 ~16
         24        SEND_VAL                                                 17
         25        DO_ICALL                                         $17     
         26        ASSIGN                                                   !3, $17
   16    27        ECHO                                                     !3
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.29 ms | 1395 KiB | 25 Q