Skip to content

Instantly share code, notes, and snippets.

@avar
Created February 21, 2010 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avar/310380 to your computer and use it in GitHub Desktop.
Save avar/310380 to your computer and use it in GitHub Desktop.
<?php
$include_now = get_include_path();
var_dump( array( 'include_now' => $include_now ) );
set_include_path('One' . PATH_SEPARATOR . 'Two' . PATH_SEPARATOR . get_include_path());
$include_now = get_include_path();
var_dump( array( 'include_now_after_change' => $include_now ) );
# lstat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=12288, ...}) = 0
# lstat("/tmp/310380", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# lstat("/tmp/310380/One", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# lstat("/tmp/310380/One/Include_me.php", {st_mode=S_IFREG|0644, st_size=8, ...}) = 0
# open("/tmp/310380/One/Include_me.php", O_RDONLY) = 3
# fstat(3, {st_mode=S_IFREG|0644, st_size=8, ...}) = 0
# read(3, "I'm one!", 8192) = 8
# read(3, "", 8192) = 0
# read(3, "", 8192) = 0
# close(3) = 0
# write(1, "I'm one!", 8I'm one!) = 8 */
require_once 'Include_me.php';
# lstat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=12288, ...}) = 0
# lstat("/tmp/310380", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# lstat("/tmp/310380/One", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# lstat("/tmp/310380/One/Include_me_too.php", {st_mode=S_IFREG|0644, st_size=14, ...}) = 0
# gettimeofday({1266767607, 450723}, NULL) = 0
# open("/tmp/310380/One/Include_me_too.php", O_RDONLY) = 3
# fstat(3, {st_mode=S_IFREG|0644, st_size=14, ...}) = 0
# read(3, "I'm one again!", 8192) = 14
# read(3, "", 8192) = 0
# read(3, "", 8192) = 0
# close(3) = 0
# write(1, "I'm one again!", 14I'm one again!) = 14
require_once dirname(__FILE__) . '/One/Include_me_too.php';
# lstat("/tmp", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=12288, ...}) = 0
# lstat("/tmp/310380", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# lstat("/tmp/310380/One", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
# lstat("/tmp/310380/One/Include_me_aswell.php", {st_mode=S_IFREG|0644, st_size=15, ...}) = 0
# open("/tmp/310380/One/Include_me_aswell.php", O_RDONLY) = 3
# fstat(3, {st_mode=S_IFREG|0644, st_size=15, ...}) = 0
# read(3, "I'm one aswell!", 8192) = 15
# read(3, "", 8192) = 0
# read(3, "", 8192) = 0
# close(3) = 0
# write(1, "I'm one aswell!", 15I'm one aswell!) = 15
require_once './One/Include_me_aswell.php';
echo "\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment