Even though a tzurat hapetach is considered like a partition, nevertheless, for a full reshut harabim, a tzurat hapetach is not effective to make it like a reshut hayachid to permit carrying there. And the reason for the matter is that while from the Torah, when one makes a tzurat hapetach on one side of a reshut harabim, and certainly on two sides, one who throws from within it to a reshut hayachid would not be liable, nevertheless, the Rabbis did not permit making an eruv in the reshut harabim itself by means of a tzurat hapetach. And this is not a wonder, for even in a bik'ah we did not permit by means of a tzurat hapetach from all sides, as I wrote in siman 362, section 30, and there is no rectification for a reshut harabim except with full partitions and doors, and that they be locked every night. And so they said in the Gemara (6b): "Jerusalem, were it not that its doors are locked at night, they would be liable for it on account of reshut harabim." And the Rambam in chapter 17 ruled that it is not specifically actual locking, but rather that they be fit for locking, meaning that the doors should not be sunken in the dust. And if they are sunken, one must clear the dust and repair them so that they are fit for locking. And even if the governor of the city does not allow locking, this is nothing, for the doors make the entrance into an entrance in this partition. And after one has made for it the rectification of doors, it is all considered like one courtyard, and its alleys do not require the rectifications of a lechi and korah. (And know, that this which says "Jerusalem, were it not that its doors are locked, they would be liable for it on account of reshut harabim," even though there are still partitions and also a tzurat hapetach over the place of the entrances. But this is due to the reason that "the multitudes come and nullify the partition," for the master of this teaching is Rabbi Yochanan, and he holds like Rabbi Yehuda on page 22, see there. But we hold like the Rabbis, that we do not say "the multitudes come and nullify the partition," as I wrote in the previous siman. And even without locking, the law of Jerusalem is only like a karmelit, and the sugya in Eruvin 101a in the Mishnah of "the market of the fatteners" and the Gemara there is also according to Rabbi Yehuda, for the anonymous Sages of Rabbi Meir are Rabbi Yehuda, for if not so, the answer of Rav Papa there would not suffice, see there and examine carefully.) (And one may be lenient like the Rambam and the Tur that specifically locking is not required, and see the Pri Megadim).
אף על פי שצורת הפתח הוי כמחיצה, מכל מקום לרשות הרבים גמור אינו מועיל צורת הפתח לעשותה כרשות היחיד לטלטל שם. וטעמו של דבר, דנהי דמן התורה כשעושה צורת הפתח בצד אחד של רשות הרבים, וכל שכן בשני צדדים, לא יתחייב הזורק מתוכו לרשות היחיד, מכל מקום מדרבנן לא התירו לעשות עירוב ברשות הרבים עצמה על ידי צורת הפתח. ואין זה תימה, שהרי גם בבקעה לא התרנו על ידי צורת הפתח מכל הצדדים, כמ"ש בסימן שס"ב סעיף ל', ואין תקון לרשות הרבים אלא במחיצות גמורות ודלתות, ושינעלו אותן בכל לילה. וכך אמרו בגמרא (ו':): "ירושלים, אלמלא דלתותיה ננעלות בלילה - חייבין עליה משום רשות הרבים". והרמב"ם בפרק י"ז פסק דלאו דווקא נעילה ממש, אלא שיהיו ראויות לנעול, והיינו שלא יהיו הדלתות משוקעות בעפר. ואם הם משוקעות - צריך לפנות האפר ומתקנן שיהיו ראויות לנעול. ואף אם שר העיר אינו מניח לנעול - אין זה כלום, דהדלתות עושות את הפתח לפתח במחיצה זו. ואחר שעשה לה תקון דלתות - חשובה כולה כחצר אחד, ואין מבואותיה צריכין תקוני לחי וקורה. (ודע, דזה שאומר "ירושלים, אלמלא דלתותיה ננעלות - חייבין עליה משום רשות הרבים", אף על גב דעדיין יש מחיצות וגם צורת הפתח על מקום הפתחים. אך זהו מטעם 'אתי רבים ומבטלי מחיצה', דמרא דשמעתא הוא רבי יוחנן, ואיהו סבירא ליה כרבי יהודה, בדף כ"ב. ע"ש. אבל אנן קיימא לן כרבנן, דלא אמרינן 'אתי רבים ומבטלי מחיצה' כמ"ש בסימן הקודם. ואפילו בלא נעילה, אין דין ירושלים רק ככרמלית, וסוגיא דעירובין ק"א. במשנה ד'שוק של פטמין' וגמרא שם גם כן אליבא דרבי יהודה הוא, דסתם חכמים דרבי מאיר היינו רבי יהודה, דאם לא כן, לא יספיק תירוצו של ר"פ שם ע"ש ודו"ק) (ויש להקל כהרמב"ם והטור דאין צריך נעילה דוקא ועיין פמ"ג).