Bug #68233 [Opn->Nab]: gettype doesn`t get the type of parsable string created by var_export

From: Date: Wed, 15 Oct 2014 16:57:37 +0000
Subject: Bug #68233 [Opn->Nab]: gettype doesn`t get the type of parsable string created by var_export
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188115@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68233&edit=1 ID: 68233 Updated by: nikic@php.net Reported by: mohit dot cse07 at gmail dot com Summary: gettype doesn`t get the type of parsable string created by var_export -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: LINUX PHP Version: 5.5.17 Block user comment: N Private report: N New Comment: var_export by default writes the exported string to stdout. If you want it to return the string instead, pass true as the second argument. See also http://php.net/var_export. Previous Comments: ------------------------------------------------------------------------ [2014-10-15 11:47:43] mohit dot cse07 at gmail dot com Description: ------------ I need to check the type of variable before proceeding my next operation, for this i used "gettype". But it output as NULL, expected to return as String. NOTE : I have also used var_export to change the type into parsable string. Please check if it is a bug or i`m doing something wrong. Thank you regards Mohit Test script: --------------- <?php $testArray = array(1,2,'mohit'); $parsableString = var_export($testArray); echo gettype($parsableString); ?> Expected result: ---------------- string Actual result: -------------- NULL ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68233&edit=1

« previous php.bugs (#188115) next »