$p->stopBuffering();
var_dump(strlen($p->getStub()));
$p->setStub("<?php
-function __autoload(\$class)
-{
+spl_autoload_register(function(\$class) {
include 'phar://' . str_replace('_', '/', \$class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_commitwrite.phar');
+ include 'phar://phar_commitwrite.phar/startup.php';
__HALT_COMPILER();
?>");
var_dump($p->getStub());
--EXPECTF--
int(6641)
string(%d) "<?php
-function __autoload($class)
-{
+spl_autoload_register(function($class) {
include 'phar://' . str_replace('_', '/', $class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_commitwrite.phar');
+ include 'phar://phar_commitwrite.phar/startup.php';
__HALT_COMPILER(); ?>
"
===DONE===
$p['file1.txt'] = 'hi';
var_dump(strlen($p->getStub()));
$p->setStub("<?php
-function __autoload(\$class)
-{
+spl_autoload_register(function(\$class) {
include 'phar://' . str_replace('_', '/', \$class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_create_in_cwd.phar');
+ include 'phar://phar_create_in_cwd.phar/startup.php';
__HALT_COMPILER();
?>");
var_dump($p->getStub());
--EXPECTF--
int(6641)
string(%d) "<?php
-function __autoload($class)
-{
+spl_autoload_register(function($class) {
include 'phar://' . str_replace('_', '/', $class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_create_in_cwd.phar');
+ include 'phar://phar_create_in_cwd.phar/startup.php';
__HALT_COMPILER(); ?>
"
===DONE===
$p->stopBuffering();
var_dump($p->getStub());
$p->setStub("<?php
-function __autoload(\$class)
-{
+spl_autoload_register(function(\$class) {
include 'phar://' . str_replace('_', '/', \$class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_commitwrite.phar');
+ include 'phar://phar_commitwrite.phar/startup.php';
__HALT_COMPILER();
?>");
var_dump($p->getStub());
string(60) "<?php // tar-based phar archive stub file
__HALT_COMPILER();"
string(%d) "<?php
-function __autoload($class)
-{
+spl_autoload_register(function($class) {
include 'phar://' . str_replace('_', '/', $class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_commitwrite.phar');
+ include 'phar://phar_commitwrite.phar/startup.php';
__HALT_COMPILER(); ?>
"
bool(true)
$p->stopBuffering();
var_dump($p->getStub());
$p->setStub("<?php
-function __autoload(\$class)
-{
+spl_autoload_register(function(\$class) {
include 'phar://' . str_replace('_', '/', \$class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_commitwrite.phar');
+ include 'phar://phar_commitwrite.phar/startup.php';
__HALT_COMPILER();
?>");
var_dump($p->getStub());
string(60) "<?php // zip-based phar archive stub file
__HALT_COMPILER();"
string(%d) "<?php
-function __autoload($class)
-{
+spl_autoload_register(function($class) {
include 'phar://' . str_replace('_', '/', $class);
-}
+});
- Phar::mapPhar('brandnewphar.phar');
- include 'phar://brandnewphar.phar/startup.php';
+ Phar::mapPhar('phar_commitwrite.phar');
+ include 'phar://phar_commitwrite.phar/startup.php';
__HALT_COMPILER(); ?>
"
bool(true)