php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77098 [ZH] Wrong explanation for object inversion from array to object
Submitted: 2018-11-03 12:59 UTC Modified: 2018-11-16 15:55 UTC
From: starksmile at 163 dot com Assigned: daijie (profile)
Status: Closed Package: Translation problem
PHP Version: 7.2.11 OS: Ubuntu
Private report: No CVE-ID: None
 [2018-11-03 12:59 UTC] starksmile at 163 dot com
Description:
------------
While in PHP Documentation for Simplified Chinese https://secure.php.net/manual/zh/language.types.object.php

It says:
<?php
$obj = (object) array('1' => 'foo');
var_dump(isset($obj->{'1'})); // outputs 'bool(false)'
var_dump(key($obj)); // outputs 'int(1)'
?>

It should be corrected.

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

$obj = (object) array('1'=>'foo');
var_dump(isset($obj->{'1'}));
//var_dump($obj);
var_dump(key($obj));

Expected result:
----------------
Modify documentation.

Actual result:
--------------
bool(true)
string(1) "1"

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-11-03 14:41 UTC] cmb@php.net
-Summary: Wrong explanation for object inversion from array to object. +Summary: [ZH] Wrong explanation for object inversion from array to object -Status: Open +Status: Verified -Package: Class/Object related +Package: Translation problem
 [2018-11-16 15:53 UTC] daijie@php.net
Automatic comment from SVN on behalf of daijie
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=345991
Log: Fix #77098 [ZH] Wrong explanation for object inversion from array to object
 [2018-11-16 15:55 UTC] daijie@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: daijie
 [2018-11-16 15:55 UTC] daijie@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 16:01:23 2020 UTC