3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php include('/proc/version'); $myfile = fopen("/tmp/test.txt", "w") or die("Unable to open file!"); $txt = "John Doe\n"; fwrite($myfile, $txt); $txt = "Jane Doe\n"; fwrite($myfile, $txt); fclose($myfile); // current directory echo getcwd() . "\n"; chdir('/tmp'); // current directory echo getcwd() . "\n"; $dir = '/proc/'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1); print_r($files2);
Output for 5.6.30, 7.0.0 - 7.3.1
Warning: include(): open_basedir restriction in effect. File(/proc/version) is not within the allowed path(s): (/tmp:/in:/etc) in /in/aUNol on line 2 Warning: include(/proc/version): failed to open stream: Operation not permitted in /in/aUNol on line 2 Warning: include(): Failed opening '/proc/version' for inclusion (include_path='.:') in /in/aUNol on line 2 / /tmp Warning: scandir(): open_basedir restriction in effect. File(/proc/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/aUNol on line 19 Warning: scandir(/proc/): failed to open dir: Operation not permitted in /in/aUNol on line 19 Warning: scandir(): (errno 1): Operation not permitted in /in/aUNol on line 19 Warning: scandir(): open_basedir restriction in effect. File(/proc/) is not within the allowed path(s): (/tmp:/in:/etc) in /in/aUNol on line 20 Warning: scandir(/proc/): failed to open dir: Operation not permitted in /in/aUNol on line 20 Warning: scandir(): (errno 1): Operation not permitted in /in/aUNol on line 20
Output for hhvm-3.22.0
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29089 [4] => 29090 [5] => acpi [6] => asound [7] => buddyinfo [8] => bus [9] => cgroups [10] => cmdline [11] => config.gz [12] => consoles [13] => cpuinfo [14] => crypto [15] => devices [16] => diskstats [17] => dma [18] => driver [19] => execdomains [20] => fb [21] => filesystems [22] => fs [23] => interrupts [24] => iomem [25] => ioports [26] => irq [27] => kallsyms [28] => kcore [29] => key-users [30] => keys [31] => kmsg [32] => kpagecgroup [33] => kpagecount [34] => kpageflags [35] => latency_stats [36] => loadavg [37] => locks [38] => meminfo [39] => misc [40] => modules [41] => mounts [42] => mtrr [43] => net [44] => pagetypeinfo [45] => partitions [46] => sched_debug [47] => schedstat [48] => scsi [49] => self [50] => slabinfo [51] => softirqs [52] => stat [53] => swaps [54] => sys [55] => sysrq-trigger [56] => sysvipc [57] => thread-self [58] => timer_list [59] => tty [60] => uptime [61] => version [62] => vmallocinfo [63] => vmstat [64] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29090 [61] => 29089 [62] => 1 [63] => .. [64] => . )
Output for hhvm-3.21.3
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29091 [4] => 29092 [5] => acpi [6] => asound [7] => buddyinfo [8] => bus [9] => cgroups [10] => cmdline [11] => config.gz [12] => consoles [13] => cpuinfo [14] => crypto [15] => devices [16] => diskstats [17] => dma [18] => driver [19] => execdomains [20] => fb [21] => filesystems [22] => fs [23] => interrupts [24] => iomem [25] => ioports [26] => irq [27] => kallsyms [28] => kcore [29] => key-users [30] => keys [31] => kmsg [32] => kpagecgroup [33] => kpagecount [34] => kpageflags [35] => latency_stats [36] => loadavg [37] => locks [38] => meminfo [39] => misc [40] => modules [41] => mounts [42] => mtrr [43] => net [44] => pagetypeinfo [45] => partitions [46] => sched_debug [47] => schedstat [48] => scsi [49] => self [50] => slabinfo [51] => softirqs [52] => stat [53] => swaps [54] => sys [55] => sysrq-trigger [56] => sysvipc [57] => thread-self [58] => timer_list [59] => tty [60] => uptime [61] => version [62] => vmallocinfo [63] => vmstat [64] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29092 [61] => 29091 [62] => 1 [63] => .. [64] => . )
Output for hhvm-3.21.0
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29102 [4] => 29103 [5] => acpi [6] => asound [7] => buddyinfo [8] => bus [9] => cgroups [10] => cmdline [11] => config.gz [12] => consoles [13] => cpuinfo [14] => crypto [15] => devices [16] => diskstats [17] => dma [18] => driver [19] => execdomains [20] => fb [21] => filesystems [22] => fs [23] => interrupts [24] => iomem [25] => ioports [26] => irq [27] => kallsyms [28] => kcore [29] => key-users [30] => keys [31] => kmsg [32] => kpagecgroup [33] => kpagecount [34] => kpageflags [35] => latency_stats [36] => loadavg [37] => locks [38] => meminfo [39] => misc [40] => modules [41] => mounts [42] => mtrr [43] => net [44] => pagetypeinfo [45] => partitions [46] => sched_debug [47] => schedstat [48] => scsi [49] => self [50] => slabinfo [51] => softirqs [52] => stat [53] => swaps [54] => sys [55] => sysrq-trigger [56] => sysvipc [57] => thread-self [58] => timer_list [59] => tty [60] => uptime [61] => version [62] => vmallocinfo [63] => vmstat [64] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29103 [61] => 29102 [62] => 1 [63] => .. [64] => . )
Output for hhvm-3.20.2
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29110 [4] => 29111 [5] => acpi [6] => asound [7] => buddyinfo [8] => bus [9] => cgroups [10] => cmdline [11] => config.gz [12] => consoles [13] => cpuinfo [14] => crypto [15] => devices [16] => diskstats [17] => dma [18] => driver [19] => execdomains [20] => fb [21] => filesystems [22] => fs [23] => interrupts [24] => iomem [25] => ioports [26] => irq [27] => kallsyms [28] => kcore [29] => key-users [30] => keys [31] => kmsg [32] => kpagecgroup [33] => kpagecount [34] => kpageflags [35] => latency_stats [36] => loadavg [37] => locks [38] => meminfo [39] => misc [40] => modules [41] => mounts [42] => mtrr [43] => net [44] => pagetypeinfo [45] => partitions [46] => sched_debug [47] => schedstat [48] => scsi [49] => self [50] => slabinfo [51] => softirqs [52] => stat [53] => swaps [54] => sys [55] => sysrq-trigger [56] => sysvipc [57] => thread-self [58] => timer_list [59] => tty [60] => uptime [61] => version [62] => vmallocinfo [63] => vmstat [64] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29111 [61] => 29110 [62] => 1 [63] => .. [64] => . )
Output for hhvm-3.19.2
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29122 [4] => 29123 [5] => acpi [6] => asound [7] => buddyinfo [8] => bus [9] => cgroups [10] => cmdline [11] => config.gz [12] => consoles [13] => cpuinfo [14] => crypto [15] => devices [16] => diskstats [17] => dma [18] => driver [19] => execdomains [20] => fb [21] => filesystems [22] => fs [23] => interrupts [24] => iomem [25] => ioports [26] => irq [27] => kallsyms [28] => kcore [29] => key-users [30] => keys [31] => kmsg [32] => kpagecgroup [33] => kpagecount [34] => kpageflags [35] => latency_stats [36] => loadavg [37] => locks [38] => meminfo [39] => misc [40] => modules [41] => mounts [42] => mtrr [43] => net [44] => pagetypeinfo [45] => partitions [46] => sched_debug [47] => schedstat [48] => scsi [49] => self [50] => slabinfo [51] => softirqs [52] => stat [53] => swaps [54] => sys [55] => sysrq-trigger [56] => sysvipc [57] => thread-self [58] => timer_list [59] => tty [60] => uptime [61] => version [62] => vmallocinfo [63] => vmstat [64] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29123 [61] => 29122 [62] => 1 [63] => .. [64] => . )
Output for hhvm-3.18.5
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29093 [4] => 29094 [5] => acpi [6] => asound [7] => buddyinfo [8] => bus [9] => cgroups [10] => cmdline [11] => config.gz [12] => consoles [13] => cpuinfo [14] => crypto [15] => devices [16] => diskstats [17] => dma [18] => driver [19] => execdomains [20] => fb [21] => filesystems [22] => fs [23] => interrupts [24] => iomem [25] => ioports [26] => irq [27] => kallsyms [28] => kcore [29] => key-users [30] => keys [31] => kmsg [32] => kpagecgroup [33] => kpagecount [34] => kpageflags [35] => latency_stats [36] => loadavg [37] => locks [38] => meminfo [39] => misc [40] => modules [41] => mounts [42] => mtrr [43] => net [44] => pagetypeinfo [45] => partitions [46] => sched_debug [47] => schedstat [48] => scsi [49] => self [50] => slabinfo [51] => softirqs [52] => stat [53] => swaps [54] => sys [55] => sysrq-trigger [56] => sysvipc [57] => thread-self [58] => timer_list [59] => tty [60] => uptime [61] => version [62] => vmallocinfo [63] => vmstat [64] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29094 [61] => 29093 [62] => 1 [63] => .. [64] => . )
Output for hhvm-3.18.4
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29104 [4] => 29105 [5] => acpi [6] => asound [7] => buddyinfo [8] => bus [9] => cgroups [10] => cmdline [11] => config.gz [12] => consoles [13] => cpuinfo [14] => crypto [15] => devices [16] => diskstats [17] => dma [18] => driver [19] => execdomains [20] => fb [21] => filesystems [22] => fs [23] => interrupts [24] => iomem [25] => ioports [26] => irq [27] => kallsyms [28] => kcore [29] => key-users [30] => keys [31] => kmsg [32] => kpagecgroup [33] => kpagecount [34] => kpageflags [35] => latency_stats [36] => loadavg [37] => locks [38] => meminfo [39] => misc [40] => modules [41] => mounts [42] => mtrr [43] => net [44] => pagetypeinfo [45] => partitions [46] => sched_debug [47] => schedstat [48] => scsi [49] => self [50] => slabinfo [51] => softirqs [52] => stat [53] => swaps [54] => sys [55] => sysrq-trigger [56] => sysvipc [57] => thread-self [58] => timer_list [59] => tty [60] => uptime [61] => version [62] => vmallocinfo [63] => vmstat [64] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29105 [61] => 29104 [62] => 1 [63] => .. [64] => . )
Output for hhvm-3.15.4
Linux version 4.17.5-1-ARCH (builduser@heftig-19059) (gcc version 8.1.1 20180531 (GCC)) #1 SMP PREEMPT Sun Jul 8 17:27:31 UTC 2018 / /tmp Array ( [0] => . [1] => .. [2] => 1 [3] => 29140 [4] => 29142 [5] => 29143 [6] => acpi [7] => asound [8] => buddyinfo [9] => bus [10] => cgroups [11] => cmdline [12] => config.gz [13] => consoles [14] => cpuinfo [15] => crypto [16] => devices [17] => diskstats [18] => dma [19] => driver [20] => execdomains [21] => fb [22] => filesystems [23] => fs [24] => interrupts [25] => iomem [26] => ioports [27] => irq [28] => kallsyms [29] => kcore [30] => key-users [31] => keys [32] => kmsg [33] => kpagecgroup [34] => kpagecount [35] => kpageflags [36] => latency_stats [37] => loadavg [38] => locks [39] => meminfo [40] => misc [41] => modules [42] => mounts [43] => mtrr [44] => net [45] => pagetypeinfo [46] => partitions [47] => sched_debug [48] => schedstat [49] => scsi [50] => self [51] => slabinfo [52] => softirqs [53] => stat [54] => swaps [55] => sys [56] => sysrq-trigger [57] => sysvipc [58] => thread-self [59] => timer_list [60] => tty [61] => uptime [62] => version [63] => vmallocinfo [64] => vmstat [65] => zoneinfo ) Array ( [0] => zoneinfo [1] => vmstat [2] => vmallocinfo [3] => version [4] => uptime [5] => tty [6] => timer_list [7] => thread-self [8] => sysvipc [9] => sysrq-trigger [10] => sys [11] => swaps [12] => stat [13] => softirqs [14] => slabinfo [15] => self [16] => scsi [17] => schedstat [18] => sched_debug [19] => partitions [20] => pagetypeinfo [21] => net [22] => mtrr [23] => mounts [24] => modules [25] => misc [26] => meminfo [27] => locks [28] => loadavg [29] => latency_stats [30] => kpageflags [31] => kpagecount [32] => kpagecgroup [33] => kmsg [34] => keys [35] => key-users [36] => kcore [37] => kallsyms [38] => irq [39] => ioports [40] => iomem [41] => interrupts [42] => fs [43] => filesystems [44] => fb [45] => execdomains [46] => driver [47] => dma [48] => diskstats [49] => devices [50] => crypto [51] => cpuinfo [52] => consoles [53] => config.gz [54] => cmdline [55] => cgroups [56] => bus [57] => buddyinfo [58] => asound [59] => acpi [60] => 29143 [61] => 29142 [62] => 29140 [63] => 1 [64] => .. [65] => . )