On Wed, Nov 21, 2001 at 10:01:34PM -0000, [EMAIL PROTECTED] wrote : 
> ID: 14165
> Updated by: sniper
> Reported By: [EMAIL PROTECTED]
> Status: Bogus
> Bug Type: Feature/Change Request
> Operating System: Linux
> PHP Version: 4.0.5
> New Comment:
> 
> Maybe if you added some example script here (which you think
> should work) we might understand what you mean?
> 
> And note that include/require don't return anything.
> They are language constructs, not functions.

    Those function do return values. However, 'require' seems to
    have a problem.

    File a.php:

        <?php
        ?>

    (i.e., it is empty)

    File b.php

    Test 1:
            <?php $foo = include 'a.php'; var_dump($foo);?>
        outputs
            php -f b.php
            int(1)
    
    Test 2:
            <?php $foo = include_once 'a.php'; var_dump($foo); ?>
        outputs
            php -f b.php 
            int(1)

    Test 3:
            <?php $foo = require 'a.php'; var_dump($foo); ?>
        outputs
            php -f b.php 
            UNKNOWN:0

    Test 4:
            <?php $foo = require_once 'a.php'; var_dump($foo); ?>
        outputs
            php -f b.php 
            int(1)


    Further testing showed that include, include_once and
    require_once behaved the same in terms of return values. The
    all returned the

        return "return_value";

    when using file a.php with <? return "return_value"; ?>
    in $foo. However, require still returns UNKNOWN:0


    This was tested with RC3 and CVS on debian linux (also on
    two different machines). However, when I asked someone else
    he reported that 'require' on freebsd also returned int(1).

    I'm using no php.ini file.

    Can somone run this tests too on same/other machines?

    - Markus

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to