Bug #70006 [NEW]: cli - function with default arg = STDOUT crash output

From: Date: Tue, 07 Jul 2015 09:21:38 +0000
Subject: Bug #70006 [NEW]: cli - function with default arg = STDOUT crash output
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194165@lists.php.net to get a copy of this message
From:             simon dot minotto at gmail dot com
Operating system: ubuntu 15.04 server
PHP version:      7.0.0alpha2
Package:          *General Issues
Bug Type:         Bug
Bug description:cli - function with default arg = STDOUT crash output

Description:
------------
using php in cli mode


With following code : 
<?php

function foo1($stream = STDOUT)
{
  //do nothing
}
echo "before\n";
foo1();
echo "after\n";


Excepted result : display
before
after


Result with php7 : 
before


Work fine with php 5.X


azureuser@php7test1:/mnt/eztv$ php -v
PHP 7.0.0alpha2 (cli) (built: Jul  7 2015 04:58:33) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0-dev, Copyright (c) 1998-2015 Zend Technologies


'./configure' '--with-apxs2=/usr/bin/apxs' '--with-mysqli'
'--enable-soap' '--enable-sockets' '--enable-sysvsem'
'--with-xsl'
'--enable-zip' '--enable-mbstring' '--with-curl'
'--with-mcrypt'
'--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/lib'
'--enable-exif'
'--with-openssl' '--enable-pcntl'

Test script:
---------------
<?php

function foo1($stream = STDOUT)
{
  //do nothing
}
echo "before\n";
foo1();
echo "after\n";


Excepted result : display
before
after

Expected result:
----------------
before
after

Actual result:
--------------
before

-- 
Edit bug report at https://bugs.php.net/bug.php?id=70006&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=70006&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=70006&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=70006&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=70006&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=70006&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=70006&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=70006&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=70006&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=70006&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=70006&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=70006&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=70006&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=70006&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=70006&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=70006&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=70006&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=70006&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=70006&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=70006&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=70006&r=mysqlcfg



Thread (3 messages)

« previous php.bugs (#194165) next »