php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37988 No output at all when type hint used incorrectly with primitive
Submitted: 2006-07-02 15:38 UTC Modified: 2006-07-02 17:09 UTC
From: ole_v2 at dsl dot pipex dot com Assigned:
Status: Not a bug Package: *Compile Issues
PHP Version: 5.1.4 OS: Ubunut Linux Server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ole_v2 at dsl dot pipex dot com
New email:
PHP Version: OS:

 

 [2006-07-02 15:38 UTC] ole_v2 at dsl dot pipex dot com
Description:
------------
I am actually generating this error with PHP 5.1.2 but I can't see that this bug has been fixed in any changelog yet. 

What happens is that the code below produces no output whatsoever.

Reproduce code:
---------------
<?php
// if you output something here, before function defination, the 
// error is triggered correctly
//echo 'example of some output that would prevent bug';

function hinted(int $monkey) {
	echo 'there are ',$monkey,' monkeys'; // note the commas
}

hinted(5);


Expected result:
----------------
Fatal error: Argument 1 passed to hinted() must be an object of class int

Actual result:
--------------
{{ No output }}

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-02 16:19 UTC] bjori@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.


 [2006-07-02 17:09 UTC] ole_v2 at dsl dot pipex dot com
Yeah, sorry just tested this on 5.1.4 and I get the expected result.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 14:01:30 2024 UTC