From 063257939b148091ab10da0dccbb0cbdb4e46a7a Mon Sep 17 00:00:00 2001 From: Nguyen Viet Date: Mon, 25 Feb 2019 00:41:44 +0700 Subject: [PATCH] add php tag + update coding style (#26602) should use all camel case for method --- guide/english/php/class/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/guide/english/php/class/index.md b/guide/english/php/class/index.md index 8e1c96a25e..beadf5123b 100644 --- a/guide/english/php/class/index.md +++ b/guide/english/php/class/index.md @@ -16,16 +16,16 @@ class Lab { // class keyword is mandatory identifier for class creation, after c return $this->name; } - public function say_my_name() { + public function sayMyName() { $name = $this->getName(); return $name; } } -$breaking_bad = 'Heisenberg'; -$lab = new Lab(); // keyword new creates instance of Lab class, variable $lab points to that instance -$lab->setName($breaking_bad); // $lab variable that points to Lab instance calls setter function setName with $breaking_bad as parameter -echo "My Name is " . $lab->say_my_name(). "!"; +$breakingBad = 'Heisenberg'; +$lab = new Lab(); +$lab->setName($breakingBad); +echo "My Name is " . $lab->sayMyName(). "!"; ```